With properties in obj-c do we need to declare instance variables?
For example, 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; ...
It's good? It compiles and works, is that the "perfect thing"? Or will I really do the following:
@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 any of the above methods if I plan to always use property accessors?
Does @synthesize help instantiate instances for me?
source share