When code with iOS navigation application, I have facing with trouble this:
where can I put the method "initdata" for UITableView? in viewWillAppear or viewDidLoad?
please help me out.
When code with iOS navigation application, I have facing with trouble this:
where can I put the method "initdata" for UITableView? in viewWillAppear or viewDidLoad?
please help me out.
You can put initData as per your requirement of the app,
if your table needs to load data every time with new Data then it should be under
Otherwise, if the table needs to be reload by a single Data which doesn't vary or there is not any editing operation performed on Data , you should use
It is better to call that in
initWithNibName:bundle:
orinitWithCoder:
method and release the loaded data in-(void)dealloc
.Also, you can have that in
viewDidLoad
and release the loaded data inviewDidUnload
. But it is better to avoid calling that fromviewWillAppear:
Edit:
I hope that array is depending on the selection in the parent view. In that case, write a setter method, which sets the condition and init the data before pushing the view controller.