Reputation: 192
Can anyone explain to me why Apple has various interfaces declared in NSArray.h?
And they declare
@interface NSArray: something something
and then they have this
@interface NSArray (NSExtendedArray)
Why do they use the NSExtendedArray in parenthesis? Thank you.
Upvotes: 0
Views: 59
Reputation: 54640
The category—which is named by the thing inside the parenthesis—defines a logical grouping of methods to extend the class. Using categories those methods can be in other header files as well. For example, the NSString
path extensions.
Upvotes: 1