Not quite the same.
In the first version you use instance variable of some class - myTableView
.
In the second version you use value, returned by same-named method. On the first step current class's method - (..)myTableView;
is called This method returns some value. And on the next step - you use - (..)setSeparatorColor:..
method of returned object. Of course, often (when you use @synthesize myTableView;
or method implementation like - (..)myTableView { return myTableView; }
) it is the same variable as in the first version, but it isn't mandatory condition (depends on your implementation). Moreover, - (..)myTableView;
can have some side effects / do additional work - not just returning a value.
An example (myTableView and [self myTableView] can be different, depending on some condition):
// myClass.h
@interface myClass : UIViewController {
UITableView *myTableView;
}
@property (nonatomic, retain) UITableView *myTableView;
@end;
// myClass.m
#import "myClass.h"
@implementation myClass
@dynamic myTableView;
- (UITableView *)myTableView {
return (someConditionIsTrue) ? myTableView : nil;
}
- (void)setMyTableView:(UITableView *)value {
if (myTableView != value) {
[myTableView release];
myTableView = [value retain];
}
}
@end;