Objective-c class can be extended by categories.
But with multi category extensions on a same class by over define a same method, the result is not defined — As following case:
@implementation someClass (category1)
- (void)foo {}
@end
@implementation someClass (category2)
- (void)foo {}
@end
In that case, compiler even won’t show any warning message. In some big project and with different people for maintenance, this kind of case is quite difficult to be addressed.
So my question is: is there any sophisticated pattern or resolution for avoiding this scenario?
For big projects, a good practice is to also add a prefix to your method names like :