Joy Online Manual
NAME |
@interface - Declare the interface for an Objective-C class or category |
SYNOPSIS |
@interface class-name [: superclass-name] [<protocol1, protocol2, ...>] {
[@private | @protected | @public]
struct-declaration-list
[@private | @protected | @public]
struct-declaration-list
...
}
[-|+][(type)] method-selector [declaration-list]
[-|+][(type)] method-selector [declaration-list]
...
@end
@interface class-name (category-name) [<protocol1, protocol2, ...>]
[-|+][(type)] method-selector [declaration-list]
[-|+][(type)] method-selector [declaration-list]
...
@end
DESCRIPTION |
This statement exists mainly for compatibility with Objective-C header files, though you can use it to create new Objective-C classes. If a class interface declaration is parsed and the class does not yet exist, the JavaScript parser will generate code to create it when the statement is executed (like the @class statement). The method prototypes are ignored both for classes and categories. |
EXAMPLE |
@interface Rectangle : NSObject
{
float width, height;
BOOL filled;
NSColor *fillColor;
}
// these prototypes are ignored
- (float) area;
- (void) fillWithColor: (NSColor *) fillColor;
@end
SEE ALSO |
Index |