Making Selections with the UITableView
I've been looking online for some time and haven't been able to find a example of using the UITable view control to make selections. For example, let's say you have a table view and in one of the cells it says, select a state. You click that cell and it takes you to another table view that has a list of states. You select your state from the list and upon making your selection, you are returned to the first table view cell and now it shows your selected state. Does anyone know how to do this or point me to a resou开发者_JAVA百科rce that shows how to do this?
Thanks!
You should try googling some of these questions... there is tons of stuff out there
I don't know of a web site that shows you how. But I've been doing something similar I think. I have two table view controllers. The first shows A high level view with only a couple of data items for each cell. If you select a row (cell), it then opens a second table view where you can modify the data. Once finished the user can then click save and return to the main list of data items. If the user has modified any of the data that displays on this main list the main list updates to reflect the changes.
I'm using core data behind the scenes, so each cell on the main list is displaying data from one core data entity. When the user taps a cell, the second table controller is created and the selected core data entity passed to it so it can display all the data from the entity.
At the same time, I set the main table view controller as an observer of notifications from the core data managed object context. If it receives a notification of a save and the entity currently selected for editing is part of that save, then the main list assumes that data has changed and it will need to update.
In it's viewDidLoad, it tells the UITableView to update the cell if there has been a change.
Thats the rough outline of what is working for me.
精彩评论