【发布时间】:2012-11-27 14:01:05
【问题描述】:
我遇到了一个奇怪的问题。当我在模拟器上运行我的应用程序时,一切正常,但在设备上,一些代码仍然没有响应!我有一个 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") {....}
}
【问题讨论】:
-
首先尝试从 iPad 上删除应用程序,然后使用 Xcode 重新安装..
标签: xcode ipad ios-simulator uiactionsheet