With properties in obj-c, do we need to declare the instance variables?
Eg if my .h file looks like this:
@interface MyClass : NSObject {
}
@property (nonatomic, retain) NSNumber *someId;
@property (nonatomic, retain) NSDate *expires;
@property (nonatomic, retain) NSString *someString;
...
Is that fine? It compiles and works, is it the 'done thing' ? Or should i really be doing the below:
@interface MyClass : NSObject {
NSNumber *someId;
NSDate *expires;
NSString *someString;
}
@property (nonatomic, retain) NSNumber *someId;
@property (nonatomic, retain) NSDate *expires;
@property (nonatomic, retain) NSString *someString;
...
Is there any difference in either of the above ways, if i plan to always use the property accessors?
Does the @synthesize take care of creating the instance vars for me?