I am following the Stanford University iOS development course on iTunes U.
In one of the demos (that I have been trying to follow), there is this code that loads the property list from an NSURL
and returns it as NSMutableDictionary
.
-(NSMutableDictionary *) words
{
NSURL *wordsURL=[NSURL URLWithString:@"http://cs193p.stanford.edu/vocabwords.txt"];
words=[[NSMutableDictionary dictionaryWithContentsOfURL:wordsURL] retain];
return words;
}
The application is successfully built, but at runtime it gives the following error and gets stuck:
I can't figure out what the problem is. Can you please help?
You're stopped at a breakpoint. That's a debugging tool, not an error. See the blue arrow/tab in the left margin, where the line numbers are? Drag that away and drop it anywhere (you'll see a "poof") to remove it, then run your project again.
You can also deactivate all breakpoints by typing ⌘-Y, the key equivalent for the menu item Debug>Deactivate Breakpoints, or you can view all your breakpoints in the Breakpoint Navigator (hit ⌘-6).
When execution stops like this, you can continue from the breakpoint, either by typing
continue
at the debugger prompt in the Console:Or hitting the "Play" button in the debugger controls. You can also type Control-⌘-Y, which is the equivalent for the menu item Debug>Continue.
The program is stopping because you have a breakpoint.. That's the blue arrow on the left of the code. Right-click it and delete.
This isn't an error. You just set a breakpoint (probably without knowing it).
Drag the little blue Chevron in the column at the left out of the way. You will see it disappear and go poof, and then you can rebuild your app and you should see it run properly.
Now, that said, I think there are some memory management mistakes in your code, but we can return to those later. ;-)