テーブル ビュー コントローラーでユーザー オプションを提供する UIActionSheet があります。以前は問題なく実装していましたが、何らかの理由で、ボタンがクリックされたときにイベント ハンドラーが起動しません。私のヘッダー ファイルでは、次のように適切なデリゲートを実装しました。
@interface GaugeDetailTableViewController : UITableViewController <UIActionSheetDelegate>
私の実装では、アクション シートをサポートする次のコードがあります。
-(void)loadPopup{
UIActionSheet *popup = [[UIActionSheet alloc]
initWithTitle:@"Options"
delegate:nil
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Add to Favorites", @"Gauge Detail Help", @"Main Menu", nil];
popup.actionSheetStyle = UIActionSheetStyleDefault;
[popup showInView:self.view];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
NSLog(@"%d\n", buttonIndex);
}
アクション シートはビュー コントローラーに正しく表示されますが、何らかの理由で、アクション シートのクリック イベント ハンドラーに到達しません。助言がありますか?ありがとう!