2011-07-19 47 views
-1

我剛用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){}]; 
} 

回答

1

崩潰的堆棧跟蹤包括[AppleSpell init]

這是獅子與Xcode 4.1已知的錯誤GM 種子

但是您已經安裝了最終版本,對嗎?檢查關於Xcode。它應該說4B110。它可能會說4B95。 Xcode最終安裝程序沒有正確升級種子。

您需要首先完全卸載Xcode 4.1 GM種子,以便Xcode安裝程序完成其工作。請參閱/ Developer文件夾中的About Xcode.pdf

如果你不是在4.1分支無論出於何種原因,您可以解決此通過在viewDidLoad關閉自動更正,但要確保您使用的是最終構建的Xcode的公共版本。

1

你通常能獲得因高估壞訪問錯誤發佈的對象。我會建議使用殭屍配置文件在儀器中運行代碼。

您可以通過按住Xcode中的運行按鈕,直到出現一個列表,然後選擇'Profile'來執行此操作。

+0

由於某些原因,儀器無法正常工作。它只是凍結在我身上。 – Jon

+0

您可以嘗試設置「NSZombieEnabled」。 [說明](http://stackoverflow.com/questions/2190227/how-do-i-set-nszombieenabled-in-xcode-4)。 – Katfish

+0

我已經有NSZombies了,我重新啓動了我的電腦,儀器仍然無法工作。 – Jon