I would like to edit a plist from Xcode which I will use to fill the table view.
The thing is I have an array of images, and the user can add one of these images to a favorites list.
This needs to be written to the plist. So I need the index number of the image and the name they choose to save it with. How can I write to a plist?
Then when they view favorites and they select an item in the table, that needs to load and display the appropriate image.
I was thinking of writing the name they choose with the number of the index appended with for e.g. “index_titleSaved” and then when reading from the plist I could just grab the number before the first _. and then show it.
Is this a good way or could it be done more efficiently?
Thanks in advance.
You can use an NSDictionary’s
writeToFilemethod, or, if you want an array (or an array of dictionarys), use NSArray’swriteToFilemethod.