How to store information in a detailed view from a TableView
-
I have a bunch of information from a few views (stored in a singleton) that I collected from the user, now all displayed in one confirmation view. How do I take this information and create a new UITableViewCell that one can click on to see the entered information. And, although this comes later, how do I make sure this data is stored between sessions and never deleted unless done so by the user. Thanks for the help.
-
Answer:
Showing the data in a UITableView is quite trivial, and I suggest you check out the http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableView_Class/Reference/Reference.html, http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/UITableViewDelegate and http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableViewDataSource_Protocol/Reference/Reference.html#//apple_ref/occ/intf/UITableViewDataSource protocols to find out how you can do that. For the storage of the data, one of the ways to do so is by using the http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html. Once you have stored the user's data, you can access the NSUserDefaults from a different view without having to pass any objects between those views / controllers.
benwiz at Stack Overflow Visit the source
Other answers
Generally you'll want to http://www.iphonedevsdk.com/forum/iphone-sdk-development/54859-sharing-data-between-view-controllers-other-objects.html to pass data between views. As far as persisting data, for light-weight data (like preferences) use http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html. For more complex data, use http://developer.apple.com/library/ios/#documentation/DataManagement/Conceptual/iPhoneCoreData01/Introduction/Introduction.html.
Nathanial Woolls
Related Q & A:
- How to store table with a large number of fields?Best solution by Stack Overflow
- How do I scroll to a certain widget in a QScrollArea?Best solution by Stack Overflow
- How can I get into a graduate program without a stellar GPA?Best solution by answers.yahoo.com
- How should I dress for a volunteer interview at a hospital?Best solution by ehow.com
- What to wear and how to present myself for a job interview at a retail store?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.