Category (Deprecated)

Deprecated in favor of the Extensions syntax now being available in all four languages, the standard Category aspect allowed to mark a class declaration as really being an extension for an existing class on the Cocoa platform.

A category is created by simply declaring a new class using the language's regular class syntax, specifying the class you want to extend as ancestor, and then applying the [Category] (Oxygene and C#) or @Category (Swift or Java) aspect to the class declaration:

type
  [Catgeory]
  StringHelpers = public class(String)
  public
    method ReversedString: String;
  end;
[Catgeory]
public class StringHelpers : String
{
    public String ReversedString()
    {
        //...
    }
}
@Catgeory public class StringHelpers : String {
    public func ReversedString() -> String {
        //...
    }
}
@Catgeory
public class StringHelpers extends String
{
    public String ReversedString()
    {
        //...
    }
}

Defined in RemObjects.Elements.Cirrus.dll

See Also