我试图弄清楚我的应用出了什么问题。它在发布模式下崩溃EXC_BAD_ACCESS,但是当我尝试检查僵尸时,它不会通过乐器崩溃。没有失败,我关闭僵尸检测,它崩溃。应用程序在发布模式下崩溃,但在启用僵尸时不崩溃
当它崩溃时,我唯一能说的是vm分配中最新的调用显示了这个viewDidLoad。所以我想知道这里有什么问题吗?
- (void)viewDidLoad
{
[super viewDidLoad];
//load abstract
if (self.abstractId > 0){
[self startQuery:@selector(getAbstractWithId:)];
}
//setup nav bar
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
[self.view addSubview:[self makeFavoriteButton]];
//add link attributes
self.linkAttributes = @{NSForegroundColorAttributeName: [UIColor colorWithHexString:emaGreen],
NSUnderlineColorAttributeName: [UIColor lightGrayColor],
NSUnderlineStyleAttributeName: @(NSUnderlinePatternSolid)};
//create text view
UITextView *tv = [[UITextView alloc] initWithFrame:self.view.frame];
tv.editable = NO;
tv.textAlignment = NSTextAlignmentLeft;
tv.text = @" ";
tv.backgroundColor = [UIColor whiteColor];
tv.scrollEnabled = YES;
tv.dataDetectorTypes = UIDataDetectorTypeLink;
tv.linkTextAttributes = self.linkAttributes; // customizes the appearance of links
tv.delegate = self;
// set the scroll indicators between nav and tabs
tv.scrollIndicatorInsets = UIEdgeInsetsMake(0,
0,
CGRectGetHeight(self.tabBarController.tabBar.frame),
0);
//add to property and view
self.tv = tv;
[self.view addSubview:tv];
//Create spinner view
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
hud.mode = MBProgressHUDModeIndeterminate;
self.hud = hud;
}
我还有什么其他的调试选项?
谢谢!
您可以尝试断点以查看哪条线路崩溃。 – ruthless
您是否检查了方案以确保仪器构建和构建版本的构建方式相同? – matt
当你启用僵尸时,整个问题就是应用程序不会再崩溃。相反,当您尝试执行一些错误的内存访问时,应该在调试控制台中看到一些输出。在启用僵尸进行调试时查找这些消息。 – rmaddy