我很难理解以下崩溃,因为它是随机发生的,我怀疑可能是多线程问题,但它是:
Incident Identifier: 0BE956AB-228A-4B1B-8A3D-A99A481F7F3F
CrashReporter Key: da7dc0be9da2f7fa677999d7093fdf2495031393
Hardware Model: iPhone3,1
Process: MyApp test [2899]
Path: /var/mobile/Applications/D6419515-BA52-4747-94C5-5626F0E69571/MyApp test.app/MyApp test
Identifier: MyApp test
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-10-24 19:42:40.289 +0200
OS Version: iPhone OS 5.0.1 (9A405)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x33e118bf __exceptionPreprocess + 163
1 libobjc.A.dylib 0x340611e5 objc_exception_throw + 33
2 CoreFoundation 0x33e14acb -[NSObject doesNotRecognizeSelector:] + 175
3 CoreFoundation 0x33e13945 ___forwarding___ + 301
4 CoreFoundation 0x33d6e680 _CF_forwarding_prep_0 + 48
5 MyApp test 0x000889f9 -[UploadPhotoViewController requestCompletedWithCode:] (UploadPhotoViewController.m:154)
6 CoreFoundation 0x33d7022b -[NSObject performSelector:withObject:] + 43
7 MyApp test 0x0005f6c9 -[ASIHTTPRequest reportFinished] (ASIHTTPRequest.m:2020)
8 CoreFoundation 0x33d7022b -[NSObject performSelector:withObject:] + 43
9 Foundation 0x357fb757 __NSThreadPerformPerform + 351
10 CoreFoundation 0x33de5b03 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
11 CoreFoundation 0x33de52cf __CFRunLoopDoSources0 + 215
12 CoreFoundation 0x33de4075 __CFRunLoopRun + 653
13 CoreFoundation 0x33d674dd CFRunLoopRunSpecific + 301
14 CoreFoundation 0x33d673a5 CFRunLoopRunInMode + 105
15 GraphicsServices 0x305ebfcd GSEventRunModal + 157
16 UIKit 0x371e8743 UIApplicationMain + 1091
17 MyApp test 0x00032025 main (main.m:16)
18 MyApp test 0x00031fd0 0x30000 + 8144
这是 UploadPhotoViewController requestCompletedWithCode: 方法:
-(void)requestCompletedWithCode:(int)statusCode{
[hud hide];
if (statusCode == 201){
UINavigationController *navVC = [self.tabBarController.viewControllers objectAtIndex:3];
// UpdatesViewController *updatesVC= (UpdatesViewController *)[navVC visibleViewController];
UpdatesViewController *updatesVC= (UpdatesViewController *)[navVC topViewController];
updatesVC.newPhoto = YES;
[self.tabBarController setSelectedIndex:3];
[self.navigationController popViewControllerAnimated:NO];
}
}
第 154 行指向:
[self.tabBarController setSelectedIndex:3];
任何人都知道可能是什么问题?
编辑
我通过这些行从以前的 VC 到 UploadPhotoViewController(手头的 VC):
[self performSegueWithIdentifier:@"UploadPhoto" sender:self];
[self dismissModalViewControllerAnimated: NO];
DismissModalViewControllerAnimated 正在关闭 UIImagePickerController。
非常感谢!