-1

参考讨论performSelector其中解释了以下行可以调用方法

SEL aSelector = findTheAppropriateSelectorForTheCurrentSituation();
[anObject performSelector: aSelector];

我的问题是调用的方法的内容是什么:
findTheAppropriateSelectorForTheCurrentSituation()?//对我来说最重要的问题

还有一个问题是,为什么我在使用这段代码时会收到警告。

1.warning:函数'findTheAppropriateSelectorForTheCurrentSituation'的隐式声明
2.warning:初始化使指针从整数而不进行
强制转换 3.“_findTheAppropriateSelectorForTheCurrentSituation”,引用自:

提前感谢您的回答

4

1 回答 1

0

您必须查看文档或反汇编包含该方法的二进制文件才能准确确定它的作用。至于您的警告,您的语法不正确。您应该使用@selector(name) 语法来创建可用于调用[obj performSelector:] 的选择器。

于 2011-11-15T10:35:23.843 回答