I need quick help! ):
I’m really confused on how to use TableViewContoller with webservice to retrieve the datasource.
Here’s how i do it.
I have a Model class where i define all the variable. Example ( Username, datetime)
Also, in the model class i have a method where it will use ASIHTTPRequest to retrieve the json datasource and create an NSMutableArray of Model class to create and store the object.
Then, in my Tableviewcontroller. I trigger the method in the model class that retrieve the json in the Viewdidload method and access the NSMutableArray to try to set my table cell.
However, nothing appear even when i retrieved the json successfully. (I’m guessing the table rendered itself before the json is retrieved back).
Is there some programming design issue with what i’m doing? ):
Give me an idea! THANKS!!!
EDIT!! (Found what happened)
Sorry guys! It’s my bad.
In the return number of section method, i return 0 instead of 1.
Which is the reason why it does not show. spent 2hrs on this. T.T
Thank you everyone!
Once the
NSMutableArrayhas been filled (aka the request has been completed) use[self.tableView reloadData];I’m assuming you also have set your
cell.textLabel.textproperty with the array’s data appropriately.