プロジェクトをARCに変換したばかりで、UIActionsheetを閉じた後、EXEC_BAD_ACCESSを取得しています。以前は機能していたので、これがARCに関連しているかどうかはわかりません。ゾンビは有効になっていますが、何も表示されません。楽器を試してみましたが、何も表示されませんでした。
これはモーダルビューコントローラー、ケース0で表示され、終了ボタンは正常に機能しますが、他の2つではアクセスエラーが発生します。
これはARCへの最初の変換ですが、ここで何かが足りませんか?
アクションシートの作成:
-(IBAction)quitPressed:(id)sender {
UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"Quit This Game?" delegate:self cancelButtonTitle:@"Keep Playing" destructiveButtonTitle:@"Quit" otherButtonTitles:@"Quit and Reveal Answers",nil];
[sheet showInView:self.view];
}
アクションシートの代表者:
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
switch (buttonIndex) {
case 0: //quit
[self dismissViewControllerAnimated:NO completion:^{
[self.delegate quitGame];
}];
break;
case 1: //quit and reveal
NSLog(@"reveal");
break;
case 2: //cancel
NSLog(@"cancel");
break;
default:
break;
}
}