我在看一种方法
-(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex在接口UIActionSheetDelegate中。actionSheet是一个参数名称还是方法名称的一部分?
下面是匹配的C声明吗?
(void) actionSheetdidDismissWithButtonIndex(UIActionSheet *actionSheet, NSInteger buttonIndex);发布于 2014-01-17 19:43:15
actionSheet是一个参数名称还是方法名称的一部分?
两者都有。完整的方法名是actionSheet:didDismissWithButtonIndex:,所以"actionSheet“就是其中的一部分。参数为actionSheet和buttonIndex。
下面是匹配的C声明吗?
是。
发布于 2014-01-17 19:58:09
在actionSheet:didDismissWithButtonIndex:方法中,有两个参数。actionSheet & buttonIndex.一个视图控制器可能是多个actionSheets的委托,所以第一个参数告诉我们触发该方法的actionSheet。类似地,一个actionSheet可能包含多个按钮,因此第二个参数告诉您哪个按钮被按下了。
对于这种方法:
-(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex这是C等价物:
(void) actionSheetdidDismissWithButtonIndex(UIActionSheet *actionSheet, NSInteger buttonIndex);https://stackoverflow.com/questions/21194456
复制相似问题