【发布时间】:2011-04-27 20:33:22
【问题描述】:
我有一个操作表,似乎只在我单击“是”按钮时调用 clickedButtonAtIndex 委托方法,而不是在“否”按钮上...这是代码:
self.myActionSheet = [[UIActionSheet alloc] initWithTitle:@"Test" delegate:self
cancelButtonTitle:@"No" destructiveButtonTitle:@"Yes" otherButtonTitles:nil];
[self.myActionSheet showInView:self.view];
[myActionSheet release];
然后是委托方法:
- (void)actionSheet:(UIActionSheet *)myActionSheet
clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
[self.myActionSheet dismissWithClickedButtonIndex:1 animated:YES];
return;
}
除非我触摸 “是”按钮。我已将其更改为具有cancelButtonTitle:nil,然后将“No”放在另一个按钮上(otherButtonTitles:@“No”,nil)。一样的。
有什么帮助吗?
谢谢!
【问题讨论】:
标签: iphone ios uiactionsheet