Ios 从操作表中删除红色破坏性按钮

Ios 从操作表中删除红色破坏性按钮,ios,objective-c,uiactionsheet,Ios,Objective C,Uiactionsheet,我试图有一个行动表,弹出没有破坏性的按钮。如果我只是尝试从下面的代码中删除破坏性按钮,我会得到一个错误:UIActionSheet没有可见的界面。有人知道为什么会这样吗?如何卸下红色按钮?谢谢大家! UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Title" delegate:self cancelButtonTitle:@"Cancel Button" destructiveButtonTitle:@"D

我试图有一个行动表,弹出没有破坏性的按钮。如果我只是尝试从下面的代码中删除破坏性按钮,我会得到一个错误:UIActionSheet没有可见的界面。有人知道为什么会这样吗?如何卸下红色按钮?谢谢大家!

UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Title" 
delegate:self cancelButtonTitle:@"Cancel Button" destructiveButtonTitle:@"Destructive 
Button" otherButtonTitles:@"Other Button 1", @"Other Button 2", nil];

只需将
nil
作为您的
destructiveButtontile
传递即可

只需使用以下代码进行尝试:

UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Title" delegate:self cancelButtonTitle:@"Cancel Button" destructiveButtonTitle:nil otherButtonTitles:@"Other Button 1", @"Other Button 2", nil];

只需将
nil
作为您的
destructiveButtontile
传递即可

只需使用以下代码进行尝试:

UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Title" delegate:self cancelButtonTitle:@"Cancel Button" destructiveButtonTitle:nil otherButtonTitles:@"Other Button 1", @"Other Button 2", nil];
我得到一个错误:UIActionSheet没有可见的界面

想进一步阅读吗?这个信息实际上是

UIActionSheet没有可见接口声明选择器
initWithTitle:delegate:cancelButtonTitle:otherButtonTitles:

是的,因为没有名字叫它的初始值设定项。您不能像这样“删除”参数(因为它更改了方法的名称,为什么您希望不存在的方法存在?

您只需将
nil
作为破坏性按钮标题传递即可

我得到一个错误:UIActionSheet没有可见的界面

想进一步阅读吗?这个信息实际上是

UIActionSheet没有可见接口声明选择器
initWithTitle:delegate:cancelButtonTitle:otherButtonTitles:

是的,因为没有名字叫它的初始值设定项。您不能像这样“删除”参数(因为它更改了方法的名称,为什么您希望不存在的方法存在?


您只需将
nil
作为破坏性按钮标题传递即可。

@Brandon您非常需要正确学习Objective-C。你不应该在不知道正确语法的情况下尝试创建复杂的应用程序。哈哈,事实上,@Brandon在不知道它的功能的情况下不会复制和粘贴!学习并实施:)@Brandon您非常需要正确地学习Objective-C。你不应该在不知道正确语法的情况下尝试创建复杂的应用程序。哈哈,事实上,@Brandon在不知道它的功能的情况下不会复制和粘贴!学习它,然后实现它:)还要注意,这个问题与所使用的IDE完全无关,因此不能用“Xcode”标记它。不要在“DestructiveButtontile”中传递任何内容,只需将其设置为nil。还要注意,这个问题与所使用的IDE完全无关,所以你不能用“Xcode”标记它。不要在“DestructiveButtontile”中传递任何东西,只需将它设置为nil