Objective-J/Class

From Wikibooks, open books for an open world
< Objective-J
Jump to: navigation, search
  • Objective-J has two types of objects, native JS objects and Objective-J objects.
    • Native JS objects are exactly what they sound like, the objects native to JavaScript.
    • Objective-J objects are a special type of native object added by Objective-J. These new objects are based on classes and traditional inheritance, like C++ or Java, instead of the prototype model.

Creating a class[edit]

Here's an example of a Person class that contains one member variable, name:

@implementation Person : CPObject
{ 
       CPString name;
}
@end