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
中设置一个断点,然后在调试器中运行应用程序。