私は iphone 開発に不慣れで、その感触をつかむために、負荷ごとにアラート ポップアップを表示する新しいビューを作成しました。
これは正しく機能しますが、アプリをシャットダウンしてから再度開くと、アプリ全体がクラッシュします。私がしているのは、アラートを表示することだけです。
これはアラートの私のコードです:
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle: @"Announcement"
message: @"This is really annoying just to make"
delegate: nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
置くべきだと思います[alert release];
が、Xcodeはそれが利用できないと言い続けていrelease
ます。
[alert release]
終了/再起動時にアプリがクラッシュし続ける理由は何ですか?
ありがとう!
編集:UIAlertViewを呼び出す周囲のコードはこちら
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
//just testing alerts..this shows up after the first load only
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle: @"Announcement"
message: @"This is really annoying just to make"
delegate: nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
}