Wednesday, November 11, 2009

Categories

Ahogy John Muchow irja:
"As an alternative to subclassing, Objective-C categories provide a means to add methods to a class. What’s intriguing, is that any methods that you add through a category become part of the class definition, so to speak. In other words, if you add a method to the NSString class, any instance, or subclass, of NSString will have access to that method.

Defining a category is identical to defining the interface for a class, with one small exception: you add a category name inside a set of parenthesis after the interface declaration..."

Categories and Extensions leiras az iPhone OS Reference Libraryban

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.