2011-07-15 100 views
2

就在最近,我開始在XCode方面遇到很多麻煩。每當我在模擬器上運行我的應用程序,並且崩潰(拋出異常或其他東西)時,即使在撤消導致最初崩潰的代碼之後,模擬器也會在下次運行時崩潰。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。沒有幫助!

+1

您是否正在使用其中一個測試版?提交一個錯誤。即使你不是你可以用蘋果提交一個bug –

回答

1

我通過刪除我的首選項文件解決了這個問題。清理項目和模擬器不起作用。我在用戶名/庫/首選項中找到了該文件。它被稱爲com.apple.Xcode.plist。在他們的名字中有一些Xcode的其他文件。我刪除了所有三個,重新啓動XCode,並且一切正常。我正在使用XCode 4.

0

你有沒有嘗試清除iOS模擬器的內容?轉到iOS模擬器>清除所有內容。

然後在xCo​​de中清理項目(可在構建菜單中獲得)(然後嘗試另一個iOS SDK)。 然後運行它。它應該已經工作了,如果不重複清理/清理並重新啓動你的Mac。