Re: NSKeyedArchiver: confusion
Re: NSKeyedArchiver: confusion
- Subject: Re: NSKeyedArchiver: confusion
- From: Jens Alfke <email@hidden>
- Date: Tue, 18 May 2010 14:10:52 -0700
On May 18, 2010, at 1:40 PM, Matthew Weinstein wrote:
> The problem: The old @"codedDataArray" is not replaced! When I open the file the old junk is all there. The old array is not discarded and replaced with the new (myRecs) array. So I cannot use NSKeyedArchiver like an NSMutableDictionary?
I’m not sure I understand. Were you expecting the code you posted to write to the file? But nowhere in that code did you specify what file to write to. Archivers don’t directly know about files; they work on in-memory data. (Yes, there are convenience class methods for reading and writing a file, but they just call NSData methods to transfer the data to/from a file.)
It sounds like what you want to do is call [NSKeyedArchiver archiveRootObject: obj toFile: file].
—Jens_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden