Apple’s Extensions
No standard exists for the Objective-C language and runtime. The Apple and Gnu implementations of Objective-C include some powerful extensions to the language. The principal extensions are categories, protocols, type encoding, and constant string objects. The extensions are used throughout Cocoa and enable much of the power and flexibility that Cocoa programmers enjoy. The Apple and GNU compilers support the same extensions.
Categories
Categories enable the addition of methods to any class and can be used as an organizational tool or as an alternative to subclassing. Categories are declared to extend existing classes. The name of the category is specified in parentheses after a class name. The following category declaration ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access