I want to remove warnings from an older project that somebody else has written.
I am confronted with over 200+ warnings about an instance method in a category overrides a method from class.
So for example:
In header:
@interface Foo : NSObject
//...unimportant code
@end
@interface Foo()
@property(nonatomic, retain)NSArray *bar;
@end
@interface Foo (Private)
//...unimportant code
@end
In body:
@implementation Foo
//...unimportant code
@end
@implementation Foo (Private)
- (NSArray*)bar
{
//...
}
@end
Generated linker waring:
ld: warning: instance method 'bar' in category from Foo.o overrides method from class in Foo.o
So obviously the getter for the bar property is implemented in the wrong category.
I can solve the problem if I copy the method in the category above.
But do I have to do this manually in over 200 classes?
Or does a refactoring tool for this problem exist or does a flag for the linker exist to suppress exactly this type of warning?