【问题标题】:Looping touchCancelled on actionSheet show在 actionSheet 显示上循环 touchCancelled
【发布时间】:2012-05-12 07:48:46
【问题描述】:

我有这个非常简单的 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");

}

点击注释时应该显示一个actionSheet。 然而,在随机运行而不是显示工作表时,它会到达 showInView 命令并永远循环回到函数的开头。在其他时候,它可以无缝运行。 ActionSheet 有问题还是我做了什么很奇怪的事情?

【问题讨论】:

    标签: xcode uiactionsheet touchescancelled


    【解决方案1】:

    我收到了有关链接组的建议,该组似乎通过延迟调用 showInview 来完成这项工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-12-15
      • 1970-01-01
      • 1970-01-01
      • 2020-06-15
      • 2016-05-12
      • 1970-01-01
      • 2011-07-12
      • 2014-06-10
      相关资源
      最近更新 更多