首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >协议UIActionSheetDelegate中的objective方法名

协议UIActionSheetDelegate中的objective方法名
EN

Stack Overflow用户
提问于 2014-01-17 19:40:02
回答 2查看 32关注 0票数 1

我在看一种方法

代码语言:javascript
复制
  -(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex

在接口UIActionSheetDelegate中。actionSheet是一个参数名称还是方法名称的一部分?

下面是匹配的C声明吗?

代码语言:javascript
复制
  (void) actionSheetdidDismissWithButtonIndex(UIActionSheet *actionSheet, NSInteger buttonIndex);
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-01-17 19:43:15

actionSheet是一个参数名称还是方法名称的一部分?

两者都有。完整的方法名是actionSheet:didDismissWithButtonIndex:,所以"actionSheet“就是其中的一部分。参数为actionSheetbuttonIndex

下面是匹配的C声明吗?

是。

票数 2
EN

Stack Overflow用户

发布于 2014-01-17 19:58:09

actionSheet:didDismissWithButtonIndex:方法中,有两个参数。actionSheet & buttonIndex.一个视图控制器可能是多个actionSheets的委托,所以第一个参数告诉我们触发该方法的actionSheet。类似地,一个actionSheet可能包含多个按钮,因此第二个参数告诉您哪个按钮被按下了。

对于这种方法:

代码语言:javascript
复制
 -(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex

这是C等价物:

代码语言:javascript
复制
(void) actionSheetdidDismissWithButtonIndex(UIActionSheet *actionSheet, NSInteger buttonIndex);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21194456

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档