Re: UITableViewController with dynamic data
Re: UITableViewController with dynamic data
- Subject: Re: UITableViewController with dynamic data
- From: Luke the Hiesterman <email@hidden>
- Date: Wed, 14 Jan 2009 12:32:16 -0800
I assume you meant numberOfSectionsInTableView:....anyway, a good
strategy might be to just go ahead and return 0 initially, and then
whenever you have successfully pulled your data from the network, do
[tableView reloadData] and then you can return the appropriate numbers
at that time, since they will be ready.
Luke
On Jan 14, 2009, at 12:24 PM, Mohan Parthasarathy wrote:
Hi,
I am using a UITableViewController and the data for the table view is
generated dynamically (fetched from the network). The data is normally
fetched based on some search. But when the Controller is loaded and
i don't
have the data ready, i want to return something back sane and later
reload
the data when it becomes ready. What is the best way to do this ?
-numberOfSectionsinRow : Is it safe to assume that this function is
called
always *first* before constructing the table ? At least i want to be
able to
initiate the fetch (if it is not already done before) here.
-As i can't return 0 for numberOfSectionsInRow, i still have to
return 1
there and in numberOfRowsInSection, return zero till the data becomes
available
The problem is that i need to initiate the fetch somewhere during
the table
construction and i don't want to put hooks into all of the tableView
delegate methods. As the data for the tableview is dynamic, i need
to tell
the framework not to call the other delegate methods till i return
something
valid in numberOfSectionsInRow/numberOfRowsInSection. Is this a safe
assumption ?
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