我有一个操作表,似乎只在调用clickedButtonAtIndex委托方法时点击“是”按钮,而不是在“否”按钮上......这里是代码:UIActionSheet委托方法不会被调用
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,然后把“否”放在另一个按钮上(otherButtonTitles:@“No”,零)。一样。
任何帮助?
谢谢!
OMG你是天才特里....是的,我有一个标签栏。这是一个错误?有关如何解决这个问题的任何建议? – DNewell 2011-04-27 20:58:44
使用showFromTabBar。这将把该表放在正确的位置,以获得所有的接触。 – 2011-04-27 21:28:08
我总是犯同样的错误:) – honcheng 2011-04-28 02:06:38