Previously I used to write my object interfaces like this:
// VERSION 1.0
@interface Planet : NSObject {
NSString *name;
NSString *type;
NSNumber *mass;
}
@property(nonatomic, retain) NSString *name;
@property(nonatomic, retain) NSString *type;
@property(nonatomic, retain) NSNumber *mass;
-(NSString *)description;
@end
But I have noticed recently that I can also write them like this. I am guessing that the removal of the iVars is a new feature that has been added to Xcode recently. Am I right in thinking that I should be looking towards using VERSION 2.0 (although I do find the earlier version more readable at the expense of the extra typing)
// VERSION 2.0
@interface Planet : NSObject
@property(nonatomic, retain) NSString *name;
@property(nonatomic, retain) NSString *type;
@property(nonatomic, retain) NSNumber *mass;
-(NSString *)description;
@end
gary.