Reputation: 25
I have a master/detail app for iPad, with a few sliders on a table view cell to control the XYZ position of an image. Every time I add another cell, another image will show on the screen that can be moved around.
When the app is restarted the table view cells that I added disappear. I already have it set up to record and save the slider values to NSUserDefaults
, but I want the cells to stay on the view. How can I save the cells, so they aren't deleted when the app is reloaded? I would also like to save the sliders' positions when the cells reload.
Upvotes: 0
Views: 66
Reputation: 4184
You probably need to add persistence to your app.
Some ideas to get you started are in this StackOverflow post.
You'll want to save the data for each of the cells, and recreate the cells when your TableView reloads upon app launch.
You can update the sliders with the stored values as well.
Posting the code you're using to do this, along with any issues, may help the community help you resolve this.
Upvotes: 1