I have an object i have made that is storing all information from twitter however i need to give it a load state so it needs to be saved to memory.
This is the code i have done so far below
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
rssParser = [[RssParser alloc] loadXMLbyURL:@"http://twitter.com/statuses/user_timeline/2smssupport.xml"];
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:rssParser];
[prefs setObject:data forKey:@"Tweets"];
[prefs synchronize];
NSData *olddata = [prefs dataForKey:@"Tweets"];
I need to get the olddata back to its original form as an ‘RssParser’
If anyone can help out it would be ace! its been ravaging my brain the last day or so!
Does RssParser implement NSCoding? If so, you just have to do
Otherwise you should read http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Archiving/Archiving.html%23//apple_ref/doc/uid/10000047-SW1