I have a question.
I am getting ready to teach a bit on Objective-C 2.0 to colleagues and I have a bit of a style question.
If i have the following defined:
@interface foo : NSObject
{
@private
NSString* myString;
}
@property(copy) myString;
-(void)displayString;
@end
Which way is better to use myString in the displayString function? Is it better to do self.myString or use myString directly.
Comming from a C++ part of me says to always use the acessors if defined (unless private and not exposed), also using the accessors allows us to make sure our bindings are updated if its a bound value, but i see a mix of code and it may depend on if the iVar is to be exposed or not.. The company i work for is now getting into iPhone and 10.5 development and i want to stress the proper design choices.