Let's say I have this interface:
// .h
@interface DataObject : NSObject {
NSString* value;
}
@property (retain) NSString* value;
@end
// .m
@implementation DataObject
@synthetize value
@end
As far as I understand, the following two snippets are identical:
DataObject *o = [[[DataObject alloc] init] autorelease];
[o setValue: @"Hello"];
DataObject *o = [[[DataObject alloc] init] autorelease];
o.value = @"Hello";
Am I correct? If yes, should I prefer one over another one? Or is it just a style preference?
Thank you.