@interface SimpleCar : NSObject {
NSString* make;
NSString* model;
NSNumber* vin;
}
@property(readwrite, retain) NSString* make;
@property(readwrite, retain) NSString* model;
@property(readwrite, retain) NSNumber* vin;
@end
The implementation:
#import "SimpleCar.h"
@implementation SimpleCar
@synthesize make, model, vin;
@end
There is no sign of setter/getter methods however, they actually will be accessible during runtime. This is the most clear implementation that I've ever seen. Interface is more declarative.
No comments:
Post a Comment