我有一个奇怪的问题。当我在模拟器上运行我的应用程序时,一切正常,但在设备上,一些代码无论如何都没有响应!我有一个 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") {....}
}