• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSKeyedArchiver: confusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSKeyedArchiver: confusion
      • From: Matthew Weinstein <email@hidden>
References: 
 >NSKeyedArchiver: confusion (From: Matthew Weinstein <email@hidden>)

  • Prev by Date: NSKeyedArchiver: confusion
  • Next by Date: Re: NSKeyedArchiver: confusion
  • Previous by thread: NSKeyedArchiver: confusion
  • Next by thread: Re: NSKeyedArchiver: confusion
  • Index(es):
    • Date
    • Thread