我剛用Xcode 4.1GM打開了我的項目(之前使用的是4.0.2)。當我在文本框中輸入數字時,我得到一個EXC Bad Access錯誤,但日誌沒有提供任何信息,所以我無法弄清楚發生了什麼。 4.1 GM中有沒有新的東西讓這件事情搞砸了?使用Xcode 4.1GM獲取EXC Bad Access
崩潰發生在main.m文件在行int retVal = UIApplicationMain(argc, argv, nil, nil);
發生這是推動其崩潰的觀點和鍵盤的代碼:
- (IBAction)weightButtonPressed
{
[self.weightView setFrame:CGRectMake(0, self.view.frame.size.height, self.view.frame.size.width, self.view.frame.size.height)];
[self.view addSubview:self.weightView];
BOOL isKgs = [[NSUserDefaults standardUserDefaults] boolForKey:@"isKgs"];
if (isKgs)
{
self.weightLabel.text = @"0 kgs";
}
else
{
self.weightLabel.text = @"0 lbs";
}
self.weightTextField.text = nil;
UIBarButtonItem *acceptButton = [[UIBarButtonItem alloc]initWithTitle:@"Next" style:UIBarButtonItemStyleDone target:self action:@selector(dismssPickerSetWeight)];
self.navigationItem.rightBarButtonItem = acceptButton;
[acceptButton release];
[weightTextField addTarget:self action:@selector(textFieldDidChange) forControlEvents:UIControlEventEditingChanged];
self.weightSelectedString = self.weightTextField.text;
self.weightTextField.hidden = YES;
[UIView animateWithDuration:.2
animations:^
{[weightTextField becomeFirstResponder]; [self.weightView setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];}
completion:^(BOOL finished){}];
}
由於某些原因,儀器無法正常工作。它只是凍結在我身上。 – Jon
您可以嘗試設置「NSZombieEnabled」。 [說明](http://stackoverflow.com/questions/2190227/how-do-i-set-nszombieenabled-in-xcode-4)。 – Katfish
我已經有NSZombies了,我重新啓動了我的電腦,儀器仍然無法工作。 – Jon