gpt4 book ai didi

iphone - 应用程序随机接收EXC_CRASH(SIGABRT)

转载 作者:行者123 更新时间:2023-12-03 17:39:54 27 4
gpt4 key购买 nike

我无法理解以下崩溃,因为它是随机发生的,并且我怀疑可能是多线程问题,但是这里是:

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。

非常感谢!

最佳答案

这可能有点过分,但是出于测试(和学习)目的,我将替换

[self.tabBarController setSelectedIndex:3];


if ([self.tabBarController respondsToSelector:@selector(setSelectedIndex:)])
[self.tabBarController setSelectedIndex:3];
else
NSLog(@"self.tabBarController is not an instance of UITabBarController");

关于iphone - 应用程序随机接收EXC_CRASH(SIGABRT),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13059369/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com