What is the nce between accessing a property via "propertyname" versus "self.propertyname" in objective-c? Can you cover in the answer:
- What is best practice?
- How do the two approaches affect memory management (retain counts / one's responsibilities for memory management)
- Any other advantages/disadvantages
The assumption for the scenario could be based on the following:
Header file
@interface AppointmentListController : UITableViewController {
UIFont *uiFont;
}
@property (nonatomic, retain) UIFont *uiFont;
Implementation
- (void)viewDidLoad {
[super viewDidLoad];
uiFont = [UIFont systemFontOfSize:14.0];
//VERSUS
self.uiFont = [UIFont systemFontOfSize:14.0];
thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…