@interface{
NSArray *array;
}
@property (nonatomic, retain) NSArray *array;
@end
@implementation
@synthesize array;
self.array = [[NSArray alloc] init];
array = [[NSArray alloc] init];
[self.array objectAtIndex:2]; [array objectAtIndex:2];
@end
它們之間有區別嗎?爲什麼我應該使用一個呢?爲什麼或爲什麼不用「自我」來稱呼對象。字首?
可能重複[何時使用類屬性上的自我?](http://stackoverflow.com/questions/867001/when-to-use-self-on-class-properties) – Chuck 2010-09-18 20:53:19