• 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
archiveRootObject:toFile: always overwrites?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

archiveRootObject:toFile: always overwrites?


  • Subject: archiveRootObject:toFile: always overwrites?
  • From: Ron Fleckner <email@hidden>
  • Date: Fri, 18 May 2007 09:51:49 +1000

Hi list,

in - applicationShouldTerminate: I do the following:

NSString *favDataPath = [NSString stringWithFormat:@"%@fav.data", appSupportPath];
[NSKeyedArchiver archiveRootObject:[self favouritesList] toFile:favDataPath];


favouritesList is an NSMutableArray of NSMenuItems.

When I unarchive the fav.data file at next startup, everything is fine. The new data is indeed the data I archived the last time the app shut down whether the new data is smaller or larger than the data which existed before the write (archive) operation.

My question:
Is what I'm doing reliable, or should I be zeroing the old data file first? I can find no description of the behaviour of archiveRootObject:toFile: in the docs for NSKeyedArchiver about this question.


I hope that makes sense.

Any opinion from an experienced Cocoa coder would be helpful.

Ron
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Prev by Date: Re: NSTableView clicked row
  • Next by Date: Predicates in Interface Builder
  • Previous by thread: Re: NSTableView clicked row
  • Next by thread: Predicates in Interface Builder
  • Index(es):
    • Date
    • Thread