I am working on a ARC based project.
I have declared a property for tableView as follows
@property (weak, nonatomic) IBOutlet UITableView *logTable.
In the ViewDidLoad I do the following
- (void)viewDidLoad
{
[super viewDidLoad];
[self.logTable.layer setCornerRadius:8.0f];//First Method
/////OR
[logTable.layer setCornerRadius:8.0f]; //Second Method
}
My question is, which is the best method i.e First or Second in my case?
I am aware that when we don't use self , we are directly accessing the ivar.But will it make
any difference in case of Weak properties.
EDIT:
Suppose if I have a strong Property as follows
@property(strong,nonatomic)NSArray *dataArray;
As far as I know , this will cause the memory leak
self.dataArray =[[NSArray alloc]init];
So which approach to be followed in this case ?
Any help is greatly appreciated.