@property, setter and getter question?

Posted by fuzzygoat on Stack Overflow See other posts from Stack Overflow or by fuzzygoat
Published on 2010-03-22T19:30:13Z Indexed on 2010/03/22 19:31 UTC
Read the original article Hit count: 298

Filed under:
|
NSString *statusValue;
NSString *currentValue;

@property(retain, nonatomic) NSString *statusValue;
@property(retain, nonatomic) NSString *currentValue;

@synthesize statusValue;
@sythnesize currentValue;

Given the above, if I am setting one variable to another is it work doing ...

[self setStatusValue: currentValue];

or should I use the property again and use

[self setStatusValue: [self currentValue]];

I suppose the latter (although maybe overkill) does tell the reader that we are using one of the objects instance variables and not some local variable.

just curious really ...

gary

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa