Reputation: 19
i'm french so maybe i'll make some mistakes, sorry about that :D
I explain my problem, I have a XMLParser who generates NSString (title, category, url, ...), I would like the stream that is generated is to save the user can read the stream even if it is not connected to the internet.
The flow generated can be found here ==> http://www.recontv.fr/testXml.xml
I try different solutions and each time, I should go about it wrong but its not working. : (
Do you need my code? Did I explain my problem?
Thank you in advance for your help!
PS: I post on differents forum for a answer, if I take it somewhere else, i pick here too.
Upvotes: 0
Views: 333
Reputation: 16827
NSUserDefaults isn't really meant to be used for saving an array from XML to it. Your main solutions are to save the XML to a file and re-parse when the user needs to access the information offline, or you can save the NSArray itself to a file using either its writeToFile: methods, or NSKeyedArchiver/NSKeyedUnarchiver. In each case you must ensure that the objects in your array conform to the NSCoding protocol.
Upvotes: 1