Re: Resetting the TableView
Re: Resetting the TableView
- Subject: Re: Resetting the TableView
- From: Davide Benini <email@hidden>
- Date: Fri, 9 Jan 2009 08:55:49 +0100
Hi,
note that viewDidLoad gets called only the first time the view is
loaded (thence its use or setting the hierarchy, things that don't
change).
Also, note the implementation of viewWillAppear:animated:
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[tableView reloadData];
// other customizations here
}
Do not forget the ":animated" part, otherwise the compiler won't
recognise your method, and it won't get called.
I hope this helps.
Davide
Hi,
I tried all four entry points, they are not getting called. My
ViewController is initialized using initWithNibName.
First time, viewDidLoad gets called. After that, neither viewDidLoad
nor the
ones you mention gets called. Do i need to do anything special ?
thanks
mohan
On Thu, Jan 8, 2009 at 4:28 PM, Wyatt Webb <email@hidden>
wrote:
Have a look at viewWillAppear/viewDidAppear and
viewWillDisappear/viewDidDisappear on the UIViewController class
You could clear out the table data on the disappear step (so you
aren't
holding data you don't need) or wait for the appear phase to set up
your
data before it's shown. These get called as you push and pop the
controllers. The viewdidLoad is just like it sounds. It only gets
called
when the view is created or loaded from the NIB (which may happen
more than
once if you have a low memory situation as, I believe, the
UIViewController
can release it's view if it's not in use). In your normal case, the
view is
loaded the first time and then kept around as you move it on and
off the
navigation stack.
HTH,
Wyatt
On Jan 8, 2009, at 4:16 PM, Mohan Parthasarathy wrote:
Yes, but where will call this when the ViewController is being made
active.
The new view was filled with data previously and i need a chance
to reset
it. Could you explain in little bit more detail ?
thanks
mohan
On Thu, Jan 8, 2009 at 4:04 PM, sanchezm <email@hidden>
wrote:
UITableView has a reloadData method
- Miguel
On Jan 8, 2009, at 3:58 PM, Mohan Parthasarathy wrote:
Hi,
I try to reuse UIViewControllers in didSelectatRowIndexPath. The
new
View
has a table which is filled with data eventually. Later the view
gets
popped
and when reusing the same ViewController the table shows old
data. Is
there
a way to clear the data while still reusing ViewControllers (as
recommended). I tried in viewdidLoad etc. but it seems to get
called
only
once the first time the View was created.
thanks
mohan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the
list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden