Im new to iOS development, and Im developing an app the uses a lot of UITableViews. I am having a hard time wrapping my head around how Im going to accomplish this app.
I am going to have the user be able to add cells to a table view, and for each cell, I need a UIViewController (this view controller will look the EXACTLY same for every cell) that will save data.
So my question is how can i write the code to create a view that only cooperates with one cell, but has the same interface for all the other cells? (The view im talking about is when the user drills down on a cell, it allows them to input some data).
Every “drilled down view” is the same, but they all must work uniquely with the cells of the table! I am having such a difficult time with this one, and any help would be greatly appreciated, if anyone knows of a tutorial I can check out, that’d be great! Thanks again!
Generally you would, if at all possible, have two view controllers, your table view controller and your detail view controller. You’ll often hear this described as a “master-detail” (the table view controller being the “master”). Your table view controller will, when someone selects an item from the tableview, trigger a detail view controller, passing it the necessary information.
You would only consider different detail view controllers (what you call the “drilled down view”) if the nature of the view is structurally different from each other. Thus, you would have one detail view controller for each “type” of detail view, and you’d just pass it the necessary information to present the appropriate details. You haven’t provided enough detail in your question to let us ascertain whether one detail view controller would be sufficient, whether you’d need a few, or whether you really need unique detail view controllers.
For more information on view controllers, I’d suggest you go through the ViewController Programming Guide as a more detailed discussion of how to construct master-detail apps is probably beyond the scope of this forum. You can probably also google “iOS master detail tutorial” and get tons of hits.