私は奇妙な問題を抱えています。シミュレーターでアプリを実行するとすべて正常に動作しますが、デバイスでは一部のコードが応答しません! シミュレーターではかなり良いように見える UIActionSheet がありますが、デバイスではまったく機能していません。iPodでも動作します:
アクションシートを表示するコードは次のとおりです。
UIActionSheet *DeleteAction = [[UIActionSheet alloc] initWithTitle:@"Select Delete Option" delegate:self cancelButtonTitle:Nil destructiveButtonTitle:nil otherButtonTitles:nil, nil];
[DeleteAction addButtonWithTitle:@"A"];
[DeleteAction addButtonWithTitle:@"B"];
[DeleteAction showInView:self.view];
そして、私はアクションシートにこのデリゲートを使用しています
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
if ([actionSheet buttonTitleAtIndex:buttonIndex] == @"A") {....}
if ([actionSheet buttonTitleAtIndex:buttonIndex] == @"B") {....}
}