I have stack category for NSMutableArray that I use in Class A
@implementation NSMutableArray (StackUtil)
- (void)push:(id)stackObject {
[self addObject:stackObject];
}
- (id)pop {
id retVal = [[self lastObject]retain];
[self removeLastObject];
return [retVal autorelease];
}
@end
How do I properly include this category for for Class B which is unrelated to Class A? Also I noticed that when I #import Class A into the header for Class C the category methods work, but I get the " object may not respond to push message" warning. Could someone clear up how categories are "reused" and why they have names (StackUtil in this case), and how they are used.