我试图弄清楚为什么我的应用程序有时会在客户设备上崩溃。我的应用程序来自 AppStore。它并不总是发生,只有在极少数情况下才会发生接缝。
这是使用的代码块
[UIView animateWithDuration:0.3 animations:^(void){ [self.spinner setAlpha:0.0]; } completion:^(BOOL finished){
if(self.spinner != nil){
[self.spinner removeFromSuperview];
self.spinner = nil;
UIBarButtonItem *externButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(openBrowser)];
[self.navigationItem setRightBarButtonItem:externButton animated:YES];
}
}];
它在 setRightBarButtomItem:animated: 上崩溃。代码块在后台线程中执行。那是问题吗?
这里是崩溃日志:
Hardware Model: iPhone5,2
Process: [THE APP] [3052]
Path: (null)
Identifier: [THE APP]
Version: 3.9.0 (3.9.0)
Code Type: ARM
Parent Process: launchd [1]
Date/Time: 2013-11-09 16:07:04.000 +0100
OS Version: iPhone OS 7.0 (11A465)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x7000000c
Crashed Thread: 13
Thread 0:
0 CoreFoundation 0x30781224 __CFStringCreateImmutableFunnel3 + 1160
1 CoreFoundation 0x306dbf38 CFStringCreateWithBytes + 48
2 Foundation 0x310c49e8 -[NSPlaceholderString initWithBytes:length:encoding:] + 100
3 Foundation 0x310c4968 +[NSString stringWithUTF8String:] + 124
4 Foundation 0x310c48b0 NSStringFromClass + 128
5 UIKit 0x32fddb68 +[_UIAppearanceCustomizableClassInfo _customizableClassInfoForViewClass:withGuideClass:] + 260
6 UIKit 0x32fddd90 -[_UIAppearanceCustomizableClassInfo _superClassInfo] + 160
7 UIKit 0x32fddcc8 existingAppearancesNodesInNodeForClassAndSuperclasses + 136
8 UIKit 0x32fdd1d0 +[_UIAppearance _applyInvocationsTo:window:matchingSelector:] + 164
9 UIKit 0x32fdd120 +[_UIAppearance _applyInvocationsTo:window:] + 24
10 UIKit 0x32f32488 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 176
11 QuartzCore 0x32bb9f40 -[CALayer layoutSublayers] + 140
12 QuartzCore 0x32bb5760 CA::Layer::layout_if_needed(CA::Transaction*) + 344
13 UIKit 0x32f47410 -[UIView(Hierarchy) layoutBelowIfNeeded] + 532
14 UIKit 0x32fe9810 -[UIBarButtonItem(UIStatic) _leftRightImagePaddingForEdgeMarginInNavBarIsMini:] + 360
15 UIKit 0x32fcf140 -[UINavigationBar _getTitleViewFrame:leftViewFrames:rightViewFrames:forItemAtIndex:returnedIdealWidthOfTextContent:availableLayoutWidthForTextContent:idealBackButtonWidth:] + 2504
16 UIKit 0x32fc6e38 -[UINavigationBar _getTitleViewFrame:leftViewFrames:rightViewFrames:forItemAtIndex:] + 632
17 UIKit 0x32fc6bb8 -[UINavigationBar _getTitleViewFrame:leftViewFrames:rightViewFrames:] + 136
18 UIKit 0x32fcd080 -[UINavigationBar _setLeftViews:rightViews:] + 1248
19 UIKit 0x32fca2b8 -[UINavigationBar _pushNavigationItem:transition:] + 464
20 UIKit 0x32fc9e98 __71-[UINavigationController pushViewController:transition:forceImmediate:]_block_invoke + 148
21 UIKit 0x32fe13a0 -[UINavigationController _startDeferredTransitionIfNeeded:] + 868
22 UIKit 0x32fe0fe8 -[UINavigationController __viewWillLayoutSubviews] + 44
23 UIKit 0x32fe0f78 -[UILayoutContainerView layoutSubviews] + 180
24 UIKit 0x32f32530 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 344
25 QuartzCore 0x32bb9f40 -[CALayer layoutSublayers] + 140
26 QuartzCore 0x32bb5760 CA::Layer::layout_if_needed(CA::Transaction*) + 344
27 QuartzCore 0x32bb55f8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 16
28 QuartzCore 0x32bb5008 CA::Context::commit_transaction(CA::Transaction*) + 224
29 QuartzCore 0x32bb4e18 CA::Transaction::commit() + 308
30 QuartzCore 0x32baeb48 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 52
31 CoreFoundation 0x30777f70 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
32 CoreFoundation 0x307758f8 __CFRunLoopDoObservers + 280
33 CoreFoundation 0x30775c48 __CFRunLoopRun + 736
34 CoreFoundation 0x306e0540 CFRunLoopRunSpecific + 524
35 CoreFoundation 0x306e0320 CFRunLoopRunInMode + 104
36 GraphicsServices 0x354172e8 GSEventRunModal + 136
37 UIKit 0x32f971e0 UIApplicationMain + 1132
38 [THE APP] 0x00059f48 main (main.m:21)
Thread 1:
0 libsystem_kernel.dylib 0x3b043838 kevent64 + 24
1 libdispatch.dylib 0x3af8c640 _dispatch_mgr_thread + 36
Thread 2:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 3:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 4:
0 libsystem_kernel.dylib 0x3b043a84 mach_msg_trap + 20
1 CoreFoundation 0x30777560 __CFRunLoopServiceMachPort + 156
2 CoreFoundation 0x30775c80 __CFRunLoopRun + 792
3 CoreFoundation 0x306e0540 CFRunLoopRunSpecific + 524
4 CoreFoundation 0x306e0320 CFRunLoopRunInMode + 104
5 Foundation 0x3111b650 +[NSURLConnection(Loader) _resourceLoadLoop:] + 320
6 Foundation 0x31190dc0 __NSThread__main__ + 1056
7 libsystem_pthread.dylib 0x3b0bcc58 _pthread_body + 136
8 libsystem_pthread.dylib 0x3b0bcbc8 _pthread_start + 96
Thread 5:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 6:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 7:
0 libsystem_kernel.dylib 0x3b056550 __semwait_signal + 24
1 Foundation 0x311904d8 +[NSThread sleepForTimeInterval:] + 144
2 [THE APP] 0x0014a870 -[KSCrashDeadlockMonitor runMonitor] + 232
3 Foundation 0x31190dc0 __NSThread__main__ + 1056
4 libsystem_pthread.dylib 0x3b0bcc58 _pthread_body + 136
5 libsystem_pthread.dylib 0x3b0bcbc8 _pthread_start + 96
Thread 8:
0 libsystem_kernel.dylib 0x3b043a84 mach_msg_trap + 20
1 [THE APP] 0x001469e0 ksmachexc_i_handleExceptions + 128
2 libsystem_pthread.dylib 0x3b0bcc58 _pthread_body + 136
3 libsystem_pthread.dylib 0x3b0bcbc8 _pthread_start + 96
Thread 9:
Thread 10:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 11:
0 libsystem_kernel.dylib 0x3b056440 select$DARWIN_EXTSN + 20
1 libsystem_pthread.dylib 0x3b0bcc58 _pthread_body + 136
2 libsystem_pthread.dylib 0x3b0bcbc8 _pthread_start + 96
Thread 12:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 13 Crashed:
0 libobjc.A.dylib 0x3aaa1b66 objc_msgSend + 6
1 UIKit 0x32fe4b80 -[UINavigationItem updateNavigationBarButtonsAnimated:] + 156
2 UIKit 0x32fe46e8 -[UINavigationItem setRightBarButtonItem:animated:] + 156
3 [THE APP] 0x000c6058 -[ProductViewController loadXML] (ProductViewController.m:978)
4 Foundation 0x31190dc0 __NSThread__main__ + 1056
5 libsystem_pthread.dylib 0x3b0bcc58 _pthread_body + 136
6 libsystem_pthread.dylib 0x3b0bcbc8 _pthread_start + 96
Thread 13 crashed with ARM Thread State:
r0: 0x15e78c40 r1: 0x33517435 r2: 0x00000000 r3: 0x00000000
r4: 0x33517435 r5: 0x33530ea0 r6: 0x15e83b00 r7: 0x037a2be0
r8: 0x15d56570 r9: 0x70000000 r10: 0x00000000 r11: 0x00000001
ip: 0x3b5be224 sp: 0x037a27f0 lr: 0x32fccffb pc: 0x3aaa1b66
cpsr: 0x20000030
Binary Images:
[cut cause of char limit]
有任何想法吗?谢谢您的帮助!