Skip to main content

Category is an Objective-C language feature that allows adding methods to an existing class in a different implementation unit without subclassing. They should not be confused with class extensions.

An Objective-C category allows extension of an existing class by adding methods to the class. The difference between a category and a sub-class is that with a category, the code that is using the class to which the category is added can use the methods added from the category without changing the variable's class.

The declaration of an Objective-C category follows this syntax:

@interface ClassName (CategoryName)
  // method declarations
@end