我試圖弄清楚我的應用出了什麼問題。它在發佈模式下崩潰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