Re: Resetting the TableView
Re: Resetting the TableView
- Subject: Re: Resetting the TableView
- From: "Mohan Parthasarathy" <email@hidden>
- Date: Fri, 9 Jan 2009 10:26:12 -0800
Hi,
Thanks. I did miss the animated part. It works now. But as far as my log
goes, i can only see ViewDidAppear and ViewWillAppear gets called.
ViewDidDisappear and ViewDidAppear never gets called. Yes, i have animated
for all four of them.
I can remove all my objects and reloadData in ViewWillAppear and it seems to
work now. Note sure why Disappear is not getting called at all..
thanks
mohan
On Thu, Jan 8, 2009 at 11:55 PM, Davide Benini <email@hidden>wrote:
> 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
>
_______________________________________________
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