剛開始時,我在XCode中編寫了一些(iOS)代碼。看起來是IDE的一部分。崩潰日誌說,IDE有一個NSRangeException。任何想法如何找到問題或重置,所以我回去?Xcode 8.1和8.2.1在啓動時崩潰
我已清除此項目的派生數據並再次啓動Xcode。它顯示一秒鐘然後崩潰。當我查看派生的數據文件夾時,它看起來像Xcode開始創建/index/debug/iphonesimulator10.1-x86_64/.xcindex/db.xcindexdb ...文件,然後在該過程中崩潰。所以可能與我在第一次崩潰時運行的模擬器有關,但我沒有使用它。
我試着回滾到之前版本的project.pbxproj,仍然有相同的崩潰問題。而Xcode只在這個項目上崩潰。我可以打開其他人。
更新:我升級到Xcode 8.2.1,仍然有相同的問題。我使用Pods,這意味着我正在使用工作區。不知道這是否導致任何問題。
這是可愛的碰撞報告。
Process: Xcode [835]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 8.1 (11544)
Build Info: IDEFrameworks-11544000000000000~4
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [835]
User ID: 501
Date/Time: 2017-01-24 21:22:55.528 -0800
OS Version: Mac OS X 10.12.1 (16B2555)
Report Version: 12
Anonymous UUID: xxx
Time Awake Since Boot: 610 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
ProductBuildVersion: 8B62
UNCAUGHT EXCEPTION (NSRangeException): *** -[__NSArrayM objectAtIndex:]: index 3 beyond bounds [0 .. 2]
UserInfo: (null)
Hints:
0: Creation Backtrace for Notification Token:
0 -[_DVTNotificationReceiver initWithBlock:queue:] (in DVTFoundation)
1 -[NSNotificationCenter(DVTNSNotificationCenterAdditions) dvt_addObserverForName:object:queue:usingBlock:] (in DVTFoundation)
2 -[_IDENavigatorOutlineViewDataSource setRootItems:] (in IDEKit)
3 -[IDENavigatorOutlineView _updateRootItems:sortDescriptors:] (in IDEKit)
4 -[IDENavigatorOutlineView setRootItems:] (in IDEKit)
5 -[IDENavigatorOutlineView _updateBoundContentArrayOrSet] (in IDEKit)
6 -[IDENavigatorOutlineView updateBoundContentArray] (in IDEKit)
7 -[NSObject(DVTBindingUtilities) updateBoundValueForBinding:] (in DVTKit)
8 -[DVTBindingHelper observeValueForKeyPath:ofObject:change:context:] (in DVTKit)
9 NSKeyValueNotifyObserver (in Foundation)
10 NSKeyValueDidChange (in Foundation)
11 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:usingBlock:] (in Foundation)
12 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] (in Foundation)
13 _NSSetObjectValueAndNotify (in Foundation)
14 -[IDEBatchFindNavigator updateScopeItems:] (in IDEKit)
15 __44-[IDEBatchFindNavigator setupLocationPicker]_block_invoke_2 (in IDEKit)
16 -[NSObject(DVTObservingConvenience) _dvt_newObserverForKeyPath:options:owner:creationBacktrace:withHandlerBlock:] (in DVTFoundation)
17 -[NSObject(DVTObservingConvenience) dvt_newObserverForKeyPath:options:withHandlerBlock:] (in DVTFoundation)
18 -[IDEBatchFindNavigator setupLocationPicker] (in IDEKit)
19 -[IDEBatchFindNavigator viewDidInstall] (in IDEKit)
20 -[DVTViewController _viewDidInstall] (in DVTKit)
21 -[_DVTViewController_ViewLifecycleInterpositions viewDidMoveToWindow] (in DVTKit)
22 -[NSView _setWindow:] (in AppKit)
23 -[NSView addSubview:] (in AppKit)
24 __42-[DVTReplacementView _setupViewController]_block_invoke (in DVTKit)
25 DVTInvokeWithFailureHint (in DVTFoundation)
26 -[DVTReplacementView _setupViewController] (in DVTKit)
27 -[DVTReplacementView installedViewController] (in DVTKit)
28 -[DVTReplacementView layoutTopDown] (in DVTKit)
29 -[DVTLayoutView_ML _reallyLayoutIfNeededTopDown] (in DVTKit)
30 +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
31 +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
32 +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
33 +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
34 +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
35 +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
36 +[DVTLayoutView_ML _recursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:] (in DVTKit)
37 -[DVTLayoutView_ML viewWillDraw] (in DVTKit)
38 -[NSView(NSInternal) _sendViewWillDraw] (in AppKit)
39 -[NSView viewWillDraw] (in AppKit)
40 -[NSView(NSInternal) _sendViewWillDraw] (in AppKit)
41 -[NSView viewWillDraw] (in AppKit)
42 -[NSView(NSInternal) _sendViewWillDraw] (in AppKit)
43 -[NSView viewWillDraw] (in AppKit)
44 -[NSView(NSInternal) _sendViewWillDraw] (in AppKit)
45 -[NSView _sendViewWillDrawInRect:clipRootView:] (in AppKit)
46 -[NSView displayIfNeeded] (in AppKit)
47 -[NSWindow displayIfNeeded] (in AppKit)
48 ___NSWindowGetDisplayCycleObserver_block_invoke.6219 (in AppKit)
49 __37+[NSDisplayCycle currentDisplayCycle]_block_invoke (in AppKit)
50 CA::Transaction::run_commit_handlers(CATransactionPhase) (in QuartzCore)
51 CA::Context::commit_transaction(CA::Transaction*) (in QuartzCore)
52 CA::Transaction::commit() (in QuartzCore)
53 __37+[NSDisplayCycle currentDisplayCycle]_block_invoke.31 (in AppKit)
54 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ (in CoreFoundation)
55 __CFRunLoopDoObservers (in CoreFoundation)
56 __CFRunLoopRun (in CoreFoundation)
57 CFRunLoopRunSpecific (in CoreFoundation)
58 RunCurrentEventLoopInMode (in HIToolbox)
59 ReceiveNextEventCommon (in HIToolbox)
60 _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox)
61 _DPSNextEvent (in AppKit)
62 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (in AppKit)
63 -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit)
64 -[NSApplication run] (in AppKit)
65 NSApplicationMain (in AppKit)
66 start (in libdyld.dylib)
Backtrace:
0 __exceptionPreprocess (in CoreFoundation)
1 DVTFailureHintExceptionPreprocessor (in DVTFoundation)
2 objc_exception_throw (in libobjc.A.dylib)
3 -[__NSArrayM objectAtIndex:] (in CoreFoundation)
4 -[_IDENavigatorOutlineViewDataSource outlineView:child:ofItem:] (in IDEKit)
5 refreshRowEntryItemAndLevelInfo (in AppKit)
6 -[NSOutlineView reloadItem:reloadChildren:] (in AppKit)
7 -[IDENavigatorOutlineView reloadItem:reloadChildren:] (in IDEKit)
8 __83-[_IDENavigatorOutlineViewDataSource _processNavigableItemGraphChangeNotification:]_block_invoke.735 (in IDEKit)
9 +[NSAnimationContext(DVTNSAnimationContextAdditions) dvt_nonAnimatedBlock:] (in DVTKit)
10 -[IDENavigatorOutlineView suspendEditingWhilePerformingBlock:] (in IDEKit)
11 -[_IDENavigatorOutlineViewDataSource _processNavigableItemGraphChangeNotification:] (in IDEKit)
12 DVTInvokeWithLazyFailureHint (in DVTFoundation)
13 __48-[_DVTNotificationReceiver receiveNotification:]_block_invoke.42 (in DVTFoundation)
14 -[_DVTNotificationReceiver receiveNotification:] (in DVTFoundation)
15 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ (in CoreFoundation)
16 _CFXRegistrationPost (in CoreFoundation)
17 ___CFXNotificationPost_block_invoke (in CoreFoundation)
18 -[_CFXNotificationRegistrar find:object:observer:enumerator:] (in CoreFoundation)
19 _CFXNotificationPost (in CoreFoundation)
20 -[NSNotificationCenter postNotificationName:object:userInfo:] (in Foundation)
21 -[NSNotificationCenter(DVTNSNotificationCenterAdditions) _dvt_postNotificationName:object:userInfo:] (in DVTFoundation)
22 -[IDENavigableItemCoordinator _postNotificationNamed:forChangedItems:] (in IDEKit)
23 -[IDENavigableItemCoordinator _delayedPostGraphAndPropertyChangeNotifications] (in IDEKit)
24 __48-[DVTDelayedInvocation initWithTarget:selector:]_block_invoke (in DVTFoundation)
25 -[DVTDelayedInvocation runBlock:] (in DVTFoundation)
26 __NSFirePerformWithOrder (in Foundation)
27 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ (in CoreFoundation)
28 __CFRunLoopDoObservers (in CoreFoundation)
29 __CFRunLoopRun (in CoreFoundation)
30 CFRunLoopRunSpecific (in CoreFoundation)
31 RunCurrentEventLoopInMode (in HIToolbox)
32 ReceiveNextEventCommon (in HIToolbox)
33 _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox)
34 _DPSNextEvent (in AppKit)
35 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (in AppKit)
36 -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit)
37 -[NSApplication run] (in AppKit)
38 NSApplicationMain (in AppKit)
39 start (in libdyld.dylib)
abort() called
看到這個http://stackoverflow.com/questions/28563918/nsarraym-objectatindex-index-2-beyond-bounds-for-empty-array –
@ Anbu.Karthik謝謝。但這是Xcode因蘋果代碼而崩潰,而不是我的。這個堆棧跟蹤屬於Xcode。 –
其他項目如何?只有在打開指定的項目時纔會崩潰? – nynohu