Joy Online Manual
| NAME |
| @implementation - Implement an Objective-C class or category |
| SYNOPSIS |
@implementation class-name [: superclass-name] [<protocol1, protocol2, ...>] [{
[@private | @protected | @public]
struct-declaration-list
[@private | @protected | @public]
struct-declaration-list
...
}]
[-|+][(type)] method-selector [declaration-list] {
statements
}
[-|+][(type)] method-selector [declaration-list] {
statements
}
...
@end
@implementation class-name (category-name) [<protocol1, protocol2, ...>]
[-|+][(type)] method-selector [declaration-list] {
statements
}
[-|+][(type)] method-selector [declaration-list] {
statements
}
...
@end
| DESCRIPTION |
| You can use this statement as an Objective-C compatible alternative to @class and @teach. See the description of those statements for details. Category names are essentially ignored by Joy: each method is taught individually. |
| EXAMPLE |
@implementation Rectangle : NSObject {
float width, height;
BOOL filled;
NSColor *fillColor;
}
- (float) area {
return width * height;
}
- (void) fillWithColor: (NSColor *) fillColor {
filled = YES;
[fillColor release];
fillColor = [fillColor retain];
}
@end
| SEE ALSO |
| Index |