When adding objects to a uitableview datasource array, how can I update the tableview while still onscreen?
I have a view controller that allows users to add an nsstring to an array that is the source for a uitableview directly underneath the add string uitextfield. I want to add the string to the uitablview a开发者_JS百科s soon as its added to the backend array. ive tried a couple different things and im not really sure how to do it. my feeling is that i need to put a reloadData somewhere but im not sure when or where.
Any suggestions?
Thanks,
Nick
I'd send the table view a reloadData
message as soon as you've added the string to your backend array.
Yes, just call [tableView reloadData]
after you have added the item to the array. If that is not working then maybe something else is wrong.
精彩评论