#import <Foundation/Foundation.h>
@interface Color : NSObject { int _color; } -(void)setColor:(int)color;
-(int)getColor;
@end @implementation Color -(void)setColor:(int)color{ _color = color; }
-(int)getColor { return _color; }
@end
int main(int argc, const char * argv[]) { @autoreleasepool { // insert code here... // NSLog(@"Hello, World!"); } Color * c = [Color new]; [c setColor:1]; NSLog(@"_color= %d",[c getColor]);
return 0; }
|