“线程 1:在断点处停止"初始化 NSURL 对象时出错 [英] "Thread 1: stopped at breakpoint" error when initializing an NSURL object
问题描述
我正在 iTunes U 上学习斯坦福大学 iOS 开发课程.
I am following the Stanford University iOS development course on iTunes U.
在其中一个演示(我一直在尝试遵循)中,有一段代码从 NSURL
加载属性列表并将其作为 NSMutableDictionary
返回.
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.
您还可以通过键入 ⌘-Y 来停用 所有 断点,这是菜单项 Debug>Deactivate Breakpoints 的等效键,或者您可以在断点导航器中查看所有断点(点击 ⌘-6).
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).
当执行像这样停止时,您可以从断点继续,方法是在控制台的调试器提示符处键入 continue
:
When execution stops like this, you can continue from the breakpoint, either by typing continue
at the debugger prompt in the Console:
(lldb) continue
或者点击调试器控件中的播放"按钮.您还可以键入 Control-⌘-Y,这与菜单项 Debug>Continue 等效.
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.
这篇关于“线程 1:在断点处停止"初始化 NSURL 对象时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!