objective c - ViewController may not respond to'method' problem -
i know common problem, googled lot , seems no luck solve problem. have @interface testviewcontroller:uiviewcontroller , in implementation file have method defined:
-(void)method1 { something; [self method1];//here need call method if statement true , line warning testviewcontroller may not respond to'method1' got } -(void)method2{ [self method1] //but there no problem line }
can me? in advance!
your method declarations missing in header. add
-(void)method1; -(void)method2;
to testviewcontroller.h file
update:
the reason why don't warning second call ([self method1]
within method2) is, compiler knows method1 @ point. (because implementation occurs before method2)
Comments
Post a Comment