Reputation: 984
With given class TestViewController
, if a method is added to its extension. But error will pop up, what is the reason?
Code:
@interface TestViewController (){
-(void) testMethod;
}
Parse error: TestViewController.m:12:5: Type name requires a specifier or qualifier
How to add a method to extension class which extend a anonymous category? thanks
Upvotes: 0
Views: 39
Reputation: 15589
Remove the {}. ivars are declared inside {}, methods are declared outside the {}.
Upvotes: 3