Let mFoo be an instance variable that's a property that has been synthesized, hence it has default setter and getter. I am wondering if one needs to be concerned with the performance hit of using
self.mFoo
vs.mFoo
if mFoo is accessed repeatedly in logical statements.
It seems to me that if one is absolutely certain that a method does not have a local variable mFoo declared, and one is doing several logical comparison with mFoo within a method, and the method is called a lot, that it makes sense not to access mFoo through its accessor method but directly.
For example:
NSMutableArray *mFoo;
@property(nonatomic, retain) NSMutableArray *mFoo;
@synthesize mFoo;
-(void)someMethod {
Bar* b;
for (int i=0; i<10000; i++) {
b = [self.mFoo objectAtIndex:i]; // <<<<<<<<<<<<<<<<
if (b.something == 123) { // do something };
}
}