I'm new to Objective-C, and I saw some open sourced code like below:
DetailedViewController.m:
@interface DetailedViewController()
@property(nonatomic, strong) UITableView *dynamicTable;
@end
@implementation DetailedViewControll
-(void)viewDidLoad
{
[super viewDidLoad];
self.dynamicTable=[[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
//configure dynamicTable
}
@end
if I declare the dynamicTable variable and use it as below:
@interface DetailedViewController()
{
// private tableview variable
UITableView *dynamicTable;
}
@end
@implementation DetailedViewControll
-(void)viewDidLoad
{
[super viewDidLoad];
dynamicTable=[[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
//configure dynamicTable
}
@end
I think the the above two ways of using dynamicTable variable are equal, Am I right?
if not, Does using property is better than using private variable?