What is the difference between a Category and a Class Extension. I believe both are used to add custom methods in existing classes. Can someone throw light on this? Examplif
@interface SomeClass ()
- (void) anAdditionalMethod;
@end
I think it is not the way to declare Category. Category must have a name
@interface SomeClass (XYZ)
- (void) anAdditionalMethod;
@end
for example
@interface NSMutableArray (NSMutableArrayCreation)
+ (id)arrayWithCapacity:(NSUInteger)numItems;
- (id)initWithCapacity:(NSUInteger)numItems;
@end
Declared for NSMutableArray by Apple