开发者

Saving the state of my UITable View

i have a checklist that is on a UITable View. The user can add/delete cells and check them and uncheck them. I need some assistance with saving the state of the checklist when the page is left, becuase when the user adds a new cell, leaves the page, and returns, the table view is back in the original s开发者_如何转开发tate i had made it be in! Does someone know my problem? Thanks Guys :D -Kurt


What you appear to be missing is that adding or deleting a row from your table does not update your source array. Typically when working with a UITableview there are three steps you must perform:

  1. add or remove the tableview cell
  2. update your source array (presumably adding or deleting objects in your context)
  3. save your context to commit the changes

This is assuming you are using Core Data for persistent store. If you are saving in memory than you are likely done at step 2.

I suggest you review the UITableView Class reference, look over the examples and step through a tutorial before trying to stumble through the process.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜