Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 如果在@selector()中使用,如何让Xcode找到方法的调用者?_Objective C_Xcode - Fatal编程技术网

Objective c 如果在@selector()中使用,如何让Xcode找到方法的调用者?

Objective c 如果在@selector()中使用,如何让Xcode找到方法的调用者?,objective-c,xcode,Objective C,Xcode,简单方法定义: -(void)方法{ //酷方法材料 } 在其他地方,我使用@selector(): NSTimer*timer=[NSTimer scheduledTimerWithTimeInterval:5目标:自选择器:@selector(coolMethod)userInfo:nil repeats:false]; [定时开火]; 如果我使用Command+单击coolMethod并选择调用者…,或使用导航到相关项目菜单,Xcode找不到此用法 使用AppCode如果我右键单击co

简单方法定义:

-(void)方法{
//酷方法材料
}
在其他地方,我使用
@selector()

NSTimer*timer=[NSTimer scheduledTimerWithTimeInterval:5目标:自选择器:@selector(coolMethod)userInfo:nil repeats:false];
[定时开火];
如果我使用Command+单击
coolMethod
并选择
调用者…
,或使用
导航到相关项目
菜单,Xcode找不到此用法

使用AppCode如果我右键单击
coolMethod
并选择
Find Usages
,它将正确找到此用法


如何让Xcode找到一个方法的所有用法,即使是在
@selector()
中调用的方法?

您唯一的选择是对
coolMethod
@selector(coolMethod)
@rmaddy进行全局搜索,这正是我所担心的。您可以在
coolMethod
中设置一个断点,然后在调试器中运行应用程序。