• 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
NSArchiver problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSArchiver problem


  • Subject: NSArchiver problem
  • From: Adrian Ridner <email@hidden>
  • Date: Wed, 29 Aug 2001 11:02:42 -0700

Hello all,

I have a problem with NSArchiver and I'm hoping someone ran into it
before. It is very simple. I'm trying to archive my own object before
my application terminates. In my delegate I listen for
NSApplicationWillTerminateNotification and call a method. Inside that
method I use:

if ([NSArchiver archiveRootObject:myObj toFile:myPath]) {
NSLog(@"Saved myObj");
}

And I unarchive the same object when my application starts. The problem
description goes as follows: The first run, everything works fine. No
objects to unarchive, so I create a new one, when user Quits, object is
saved. Then 2nd run for the app it restores the object, but when it
goes to save it quits with signal 10 (SIGBUS). After some digging I
found out that if I physically delete the file created the previous time
(from the Finder) anytime before I Quit my app, the object will be
archived successfully. What really throws me off is that if I
programatically delete the file, it will not work. What am I missing?

Thanks for your help,

Adrian

***************************************
Adrian Ridner
Mac Software Team
Hewlett-Packard
***************************************


  • Prev by Date: Re: Another Cocoa Bug!! :<
  • Next by Date: Re: Abstract classes and methods
  • Previous by thread: Re: Looking for a workaround for a Bug in Cocoa Window
  • Next by thread: Re: NSArchiver problem
  • Index(es):
    • Date
    • Thread