Reputation: 609
This is a bit of a silly question but I don't know how to get around it.
I am making an iphone app and I am just trying to display a progress wheel while my UITableView is loading. I try to test if the view is loading but I get an error: 'request for member 'loading' is something not a structure or a union'. So, I'm not sure how I am supposed to test for when I should show the wheel. maybe I have mistyped something? I don't know, but I am getting pretty frustrated with this silly problem. So, any help would be appreciated. Thanks!
- (void) updateWheel {
//curtable is a uitableView
//wheel is a uiactivityIndicatorView
if (!curTbl.loading) { //THE ERROR IS FOR THIS LINE
[wheel stopAnimating];
} else {
[wheel startAnimating];
}
}
Upvotes: 0
Views: 286
Reputation: 10083
There is no loading property of a UITableView, which would be why you are getting a compile error on that line of code. As DarkDust said, you use a data source protocol to feed data into the cells of a table view. As views come into view, the system requests the cell and data via this delegate, and you provide the cell formatting and data in these protocol methods.
Upvotes: 1
Reputation: 92432
I'm not sure what you mean with "while my UITableView is loading". Do you mean while it is reloading data from the data source ? Because the UITableView is not involved any loading (and has no member "loading".
If you do [myTableView reloadData]
then it is querying its dataSource
. See the documentation of UITableViewDataSource protocol.
So YOU are responsible for loading data and then informing the table view that something in the data source has changed, and thus you should know when you are still loading data for your data source implementation :-)
Upvotes: 0