Re: NSKeyedArchiver: confusion
Re: NSKeyedArchiver: confusion
- Subject: Re: NSKeyedArchiver: confusion
- From: Michael Ash <email@hidden>
- Date: Tue, 18 May 2010 17:32:25 -0400
On Tue, May 18, 2010 at 5:21 PM, Matthew Weinstein <email@hidden> wrote:
> My mistake for not being clear:
> I have an NSData in an object;
> I read that data using a keyedArchiver to get to the chunk I want.
>
> I want to replace a chunk of that data with another using the same key. (the file part is immaterial).
You can't do this. NSKeyedArchiver/Unarchiver does not support
in-place modification or partial changes. You must read an entire
archive, and write out a complete new archive.
If you need incremental modifications, you'll need to use some other
storage/serialization strategy, such as SQLite or CoreData.
Mike
_______________________________________________
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