一个视图中的两个操作表
我想要两个操作表,但是我如何知道其中哪个被称为方法 -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
I want to have two Action Sheets, but how can I know for which of them is called method -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我将设置这些操作表的标签并检查 clickedButtonAtIndex 中的标签。
I would set the tag of those action sheets and checks the tag in the clickedButtonAtIndex.
创建操作表时,存储引用,然后签入委托方法。
When you create your action sheet, store a reference and then check in the delegate method.
请注意,当在每个操作表中点击“取消”时,此操作将不起作用。如果在第一个操作表中选择“取消”,则需要清除“actionsheet1”;如果在第二个操作表中选择“取消”,则需要清除“actionsheet2”。
Careful this will not work when cancel is tapped in each of the action sheets You need to clear actionsheet1 if cancel is selected in the first actionsheet and actionsheet2 if cancel is selected in second actionsheet.