Hello coders,
I'm having problems saving the data of my application so i can restore next time it launches.
I'm interested in saving an NSMutableArray which contains instances of my custom class FeedGroup
FeedGroup contains and NSMutableArray with instances of Feed and some ivars (NSMutableDictionary, and NSMutableAttributedString)
Instances of Feed contains a few ivars (3 x NSMutableArray, 1x NSMutableDictionary and 1x NSmutableAttributedString).
Both Feed and FeedGroup implement the NSCoding protocol.
I've tried saving the array that contains instances of FeedGroup by sending it the method
writeToFile: atomically
I've also using an NSKeyedArchiver like this:
[NSKeyedArchiver archiveRootObject:feedGroups toFile
"feedGroup.plist"];
my last approch seems to save a file (the first didn't) but when i try to restore the data with:
feedGroups = [NSKeyedUnarchiver unarchiveObjectWithFile
"feedGroup.plist"];
But it doesn't restore my data properly (my NSOutlineView doesn't show the data when i relaunch).
I archive the file in another file than the one i try to restore it (not sure if this maeks a difference).
Any help would be really appreciated,
Mads Hartmann Jensen
I'm having problems saving the data of my application so i can restore next time it launches.
I'm interested in saving an NSMutableArray which contains instances of my custom class FeedGroup
FeedGroup contains and NSMutableArray with instances of Feed and some ivars (NSMutableDictionary, and NSMutableAttributedString)
Instances of Feed contains a few ivars (3 x NSMutableArray, 1x NSMutableDictionary and 1x NSmutableAttributedString).
Both Feed and FeedGroup implement the NSCoding protocol.
I've tried saving the array that contains instances of FeedGroup by sending it the method
writeToFile: atomically
I've also using an NSKeyedArchiver like this:
[NSKeyedArchiver archiveRootObject:feedGroups toFile
my last approch seems to save a file (the first didn't) but when i try to restore the data with:
feedGroups = [NSKeyedUnarchiver unarchiveObjectWithFile
But it doesn't restore my data properly (my NSOutlineView doesn't show the data when i relaunch).
I archive the file in another file than the one i try to restore it (not sure if this maeks a difference).
Any help would be really appreciated,
Mads Hartmann Jensen