草庐IT

myAwesomeMethod

全部标签

iphone - 了解 Objective-C 范围问题

以下是ViewController实现的片段:-(void)myOtherAwesomeMethod{[selfmyAwesomeMethod];//CompileERRORhere:Receivertypeforinstancemessagedoesnotdeclareamethodwithselector}-(void)myAwesomeMethod{NSLog(@"%@",@"Callingmyawesomemethod...");}-(void)viewDidLoad{[selfmyAwesomeMethod];[selfmyOtherAwesomeMethod];}我的头文件