Objective-C LanguageCategories

Syntax

  • @interface ClassName (categoryName) // ClassName is the class to be extended

  • // Method and property declarations

  • @end

Remarks

To avoid method name clashes, it is recommended to use prefixes (like xyz_ in the example). If methods with the same name exist, it is undefined which one will be used in the runtime.

Related Examples