就在最近,我开始在XCode上遇到很多麻烦。每当我在模拟器上运行我的应用程序,它崩溃(抛出异常或其他东西)时,即使我撤消导致初始崩溃的代码,模拟器也会在下次运行时崩溃。
例如,在init方法中,我调用
self = [super init];
return self;
我可以运行一百次,每次都能正常运行。但如果我打电话
self = [super init];
[super wrlgnqelrguqrngouqerngerg];
return self;
然后崩溃,应该如此。但是,如果我撤消随机消息调用,那么它再一次是
self = [super init];
return self;
我再次在模拟器上运行它,它崩溃了!即使我解除了导致崩溃的代码。当我点击运行时,它会显示XCode内部错误,当我点击显示详细信息时它会给我这个:
ASSERTION FAILURE in /SourceCache/IDEKit/IDEKit-303/Framework/Classes/Workspace/IDEWorkspaceTabController.m:2327
Details: Assertion failed: [suppressionTargetValue isEqualToString:_kUserDefaults_IDESuppressStopExecutionWarningTargetValue_Add]
Object: <IDEWorkspaceTabController: 0x201759bc0>
Method: -_showWarningForBuild:forOtherExecution:trackersToStop:taskActionBlock:
Thread: <NSThread: 0x2000217a0>{name = (null), num = 1}
Hints: None
Backtrace:
0 0x0000000100949773 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:] (in IDEKit)
1 0x000000010006d394 _DVTAssertionFailureHandler (in DVTFoundation)
2 0x0000000100931e02 -[IDEWorkspaceTabController _showWarningForBuild:forOtherExecution:trackersToStop:taskActionBlock:] (in IDEKit)
3 0x00000001008e830b -[IDEWorkspaceTabController _performContextTask:command:commandName:] (in IDEKit)
4 0x00007fff81fd7e9a -[NSApplication sendAction:to:from:] (in AppKit)
5 0x00000001001cf63c -[DVTApplication sendAction:to:from:] (in DVTKit)
6 0x000000010085b656 -[IDEApplication sendAction:to:from:] (in IDEKit)
7 0x00007fff81fd7e9a -[NSApplication sendAction:to:from:] (in AppKit)
8 0x00000001001cf63c -[DVTApplication sendAction:to:from:] (in DVTKit)
9 0x000000010085b656 -[IDEApplication sendAction:to:from:] (in IDEKit)
10 0x000000010031b9f3 -[DVTDelayedMenuButtonCell trackMouse:inRect:ofView:untilMouseUp:] (in DVTKit)
11 0x00007fff82062215 -[NSControl mouseDown:] (in AppKit)
12 0x00007fff81f7c34f -[NSWindow sendEvent:] (in AppKit)
13 0x00007fff81eb1a86 -[NSApplication sendEvent:] (in AppKit)
14 0x000000010085b36e -[IDEApplication sendEvent:] (in IDEKit)
15 0x00007fff81e484da -[NSApplication run] (in AppKit)
16 0x00007fff81e411a8 NSApplicationMain (in AppKit)
17 0x0000000100000eec
18 0x0000000000000002
然后我点击继续,模拟器启动,应用程序崩溃,我得到:
Couldn't register NI.nipod-app-final with the bootstrap server. Error: unknown error code.
This generally means that another instance of this process was already running or is hung in the debugger.
我尝试重新安装XCode。没有帮助!
答案 0 :(得分:1)
我通过删除我的偏好文件解决了这个问题。清洁项目和模拟器不起作用。我在username / library / preferences中找到了该文件。它被称为com.apple.Xcode.plist。还有一些其他文件,其名称中包含Xcode。我删除了所有三个,重新启动的XCode,一切正常。我正在使用XCode 4。
答案 1 :(得分:0)
您是否尝试过清除iOS模拟器内容?转到iOS模拟器&gt;清除所有内容。
然后在xCode中清理你的项目(在构建菜单中可用)(然后可能尝试另一个iOS SDK)。 然后运行它。它应该有效,如果不重复清除/清理并重新启动你的mac。