2011-11-10 17 views
0

Xcode 4.2で[alertsuccess release]でエラーが発生しました。リリースが利用できず、自動参照カウントモードでは利用できないとし、ARCはリリースの明示的なメッセージ送信を禁止しています。[alertsuccess release]; xcode 4.2

私のアプリとコードは、Xcode 4.1で動作します。なにが問題ですか?

if([serverOutput isEqualToString:@"Yes"]){ 


    UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@"Congrats" message:@"You are authorized " 
                  delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; 

    [alertsuccess show]; 
    [alertsuccess release]; 




} else { 
    UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Username or Password Incorrect" 
                  delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; 
    [alertsuccess show]; 
    [alertsuccess release]; 

} 
+1

[コンパイル時にARCエラーが発生する可能性があります](http://stackoverflow.com/questions/7164848/arc-error-when-compiling) –

答えて

0

自動参照カウント機能では、オブジェクトを保持したり解放したりすることはもうありません。

プロジェクトのビルド設定でARCを無効にすることも、-releaseへの呼び出しを削除することもできます。