【发布时间】:2013-04-29 13:38:43
【问题描述】:
我的 iOS 应用程序的 bugsense 收到了一些崩溃报告,我无法重现,因此无法调试。一天发生 200 多次,所以我想这很严重。
我读过一些关于 NSZombie 的文章,但我无法重现崩溃,所以我猜它没用。 这是一个崩溃报告:
SIGSEGV
0 libobjc.A.dylib 0x3aa515b0 objc_msgSend + 15
1 UIKit 0x34d493df + 294
2 UIKit 0x34cae469 + 52
3 QuartzCore 0x34926099 + 160
4 QuartzCore 0x34925ff1 + 64
5 IOMobileFramebuffer 0x36ba1fd7 + 154
6 IOKit 0x33920449 IODispatchCalloutFromCFMessage + 192
7 CoreFoundation 0x32d035db + 118
8 CoreFoundation 0x32d0e173 + 34
9 CoreFoundation 0x32d0e117 + 138
10 CoreFoundation 0x32d0cf99 + 1384
11 CoreFoundation 0x32c7febd CFRunLoopRunSpecific + 356
12 CoreFoundation 0x32c7fd49 CFRunLoopRunInMode + 104
13 GraphicsServices 0x368562eb GSEventRunModal + 74
14 UIKit 0x34b95301 UIApplicationMain + 1120
15 My Bet main (main.m:16) Live 0x000705e7 0x6d000 + 13799
在一些类似的线程上,他们认为问题可能出在 UIAlertView 中,所以这里有一个关于我如何使用它们的示例: 在文件.h
UIAlertView *alertView;
在文件.m中
-(void)wait{
UIActivityIndicatorView * activityView = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
activityView.frame = CGRectMake(121.0f, 50.0f, 37.0f, 37.0f);
[activityView startAnimating];
alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Searching...", @"") message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
[alertView addSubview:activityView];
[alertView show];
[NSThread detachNewThreadSelector:@selector(function) toTarget:self withObject:nil];
}
-(void)function{
// Do some web request
[alertView dismissWithClickedButtonIndex:0 animated:NO];
if(response == nil){
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Timeout", @"") message:NSLocalizedString(@"Connection timeout", @"") delegate:nil cancelButtonTitle:NSLocalizedString(@"Close", @"") otherButtonTitles:nil ];
[alert show];
}
}
关于我如何着手解决这个问题的任何提示? 谢谢
【问题讨论】:
标签: ios multithreading uialertview segmentation-fault objc-message-send