I was wondering how to suppress the warning:
Category is implementing a method which will also be implemented by
its primary class.
I have this for a specific code category:
+ (UIFont *)systemFontOfSize:(CGFloat)fontSize {
return [self aCustomFontOfSize:fontSize];
}
A category allows you to add new methods to an existing class. If you want to reimplement a method that already exists in the class, you typically create a subclass instead of a category.
Apple documentation: Customizing existing classes
Two methods with the exact same signature in the same class would lead to unpredictable behavior, because each caller cannot specify which implementation they want.
So, you should either use a category and provide method names that are new and unique for the class, or subclass if you want to change the behavior of an existing method in a class.