iOS UIActionSheet回调可以在模拟器中工作,但不能在手机上工作

iOS UIActionSheet回调可以在模拟器中工作,但不能在手机上工作,ios,objective-c,callback,uiactionsheet,uiactionsheetdelegate,Ios,Objective C,Callback,Uiactionsheet,Uiactionsheetdelegate,我有一个操作表,当它的一个选项被成功点击时,在模拟器中运行时调用ClickedButtonIndex,但在Xcode 6的iPhone 5s上测试时,它没有到达回调 标题 @protocol SGETriggerToolBarDelegate -(void)showCustomEditView; @end @interface SGETriggerToolBarController : UIViewController <UIActionSheetDelegate> @prope

我有一个操作表,当它的一个选项被成功点击时,在模拟器中运行时调用ClickedButtonIndex,但在Xcode 6的iPhone 5s上测试时,它没有到达回调

标题

@protocol SGETriggerToolBarDelegate
-(void)showCustomEditView;
@end

@interface SGETriggerToolBarController : UIViewController <UIActionSheetDelegate>

@property (nonatomic, assign) id <SGETriggerToolBarDelegate> delegate;
@property (nonatomic, strong) UIToolbar *toolbar;

如果你的动作表被它的superview剪辑了。某些控件可能对触摸不响应

替换

[actionSheet showFromToolbar:self.toolbar];


为我解决了这个问题。

FYI-组合两个取消按钮行:actionSheet.cancelButtonIndex=[actionSheet addButtonWithTitle:@Cancel];。
[actionSheet showFromToolbar:self.toolbar];
[actionSheet showInView:[UIApplication sharedApplication].keyWindow];