Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

guydor

macrumors member
Original poster
Mar 10, 2009
67
0
Hi,

I have an UITableView with an edit button that allows the user to change the rows order.
I would like to save this order even the user quits the application.
Unfortunately I have no experience with NSUserDefaults.
Would you like to instruct me how to save the UITableView rows order please?



Thanks!
 
You have to save the order of the datasource for the uitableview in the nsuserdefaults. Depending on if you are using custom objects to load data into the tableview your objects me need to conform to nsencoding and decode to be able to store the data in the user defaults. One such method for saving the data would be at the end of the tableview editing method that you write the data to the userdefaults. Then on viewDidLoad you reload the data for next time.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.