我有这个非常简单的 Xcode 处理程序:
-(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
[super touchesCancelled:touches withEvent:event];
NSLog(@"taxi touchcancelled");
NSString *postOption=NSLocalizedString(@"SELECTEDTAXI", @"");
NSString *info=NSLocalizedString(@"INFORMATION", @"");
NSString *call=NSLocalizedString(@"CALL", @"");
NSString *cancel=NSLocalizedString(@"CANCEL", @"");
NSLog(@"delegate=%@",myTA.delegate);
UIActionSheet *myActionSheet= [[UIActionSheet alloc] initWithTitle:postOption delegate:self cancelButtonTitle:cancel destructiveButtonTitle:call otherButtonTitles:info, nil];
//[myActionSheet showFromToolbar:myTA.delegate.myToolBar];
[myActionSheet showInView:myTA.delegate.view];
NSLog(@"after the show");
}
在单击注释时应该可视化一个动作表。然而,在随机运行而不是显示工作表时,它会到达 showInView 命令并永远循环回到函数的开头。在其他时候,它可以无缝运行。ActionSheet 有问题还是我做了一些很奇怪的事情?