Search code examples
objective-cobjective-c-category

Does a category method can extend to a subclass?


@interface NSOutlineView (addations)

  - (id)selectedItem

@end

@interface AAAOutlineView : NSOutlineView
@end

So, Does the AAAOutlineView's object can invoke selectedItem method or not?

Thanks for helping


Solution

  • Category methods apply to all objects of classes on which the category is defined. Since each AAAOutlineView is an NSOutlineView object, all category methods apply to AAAOutlineView objects as well.