Calling Objective C code
Cocoa bridge

Next:Subclassing Objective C classes

Before an Objective C class can be used, it must be imported; by default, a small set of common classes are imported automatically, but additional classes can be imported as needed.

Every imported Objective C class has as corresponding class word in the cocoa.classes vocabulary. Class words push the class object in the stack, allowing class methods to be invoked.

Messages can be sent to classes and instances using a pair of parsing words:


These parsing words are actually syntax sugar for a pair of ordinary words; they can be used instead of the parsing words if the selector name is dynamically computed:
send ( receiver args... signature selector -- return... )

super-send ( receiver args... signature selector -- return... )