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 ...

Get Cocoa® Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.