UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Congratulations" message:message delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"View", nil];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(110, 100, 80, 80)];
NSString *imagePath = [NSString stringWithFormat:@"%@", [Array objectAtIndex:x]];
UIImage *bkgImg = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:imagePath ofType:@"png"]];
imageView.image = bkgImg;
[bkgImg release];
[alert addSubview:imageView];
[imageView release];
[alert show];
[alert release];
これは、アラートビューを作成するために使用しているコードです。現在、ユーザーがボタンの1つを押すと、新しいビューコントローラーが読み込まれるように設定しています。UIAlertViewにサブビューを追加するまでは正常に機能しました。これで、新しい画面にアニメーション化するたびに、プログラムがクラッシュするだけです。私はiPhoneの開発にかなり慣れていないので、助けていただければ幸いです。