Im new to iOS programming and I have created my first app for iPad which handles several views. Since I dont know how memory and objects are managed (The app havent crashed but Im trying to prevent them) I have this question.
In general Which is better to have for updating info on the views when navigating to the a child view and returning to the parent or the parent of the parent and so on:
Option 1
instantiate on the Parent viewWillAppear
method the Child controller
Parent:
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.supportDetailController = [[BIDSupportDetail alloc] init];
}
Option 2
Instantiate on the viewDidLoad Parent method the child controller and on the Child viewWillAppear
method call [self.tablewView reloadData]
Parent:
-(void)viewDidLoad
{
[super viewDidLoad];
self.supportDetailController = [[BIDSupportDetail alloc] init];
}
Child:
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.tablewView reloadData]
}
Im using iOS 6.1 and Xcode 4.6.2