• 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
NSUnarchiver: How to deal with locked file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSUnarchiver: How to deal with locked file?


  • Subject: NSUnarchiver: How to deal with locked file?
  • From: Stephan Ruggiero <email@hidden>
  • Date: Sat, 25 Feb 2006 08:57:13 +0100

Hello,

I have App AAA archiving a NSArray to a file using the following code:

if ([NSArchiver archiveRootObject:array toFile:file]) {
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"AAA" object:@"newVersionAvailable"];
}


App BBB is registered to wait for that notification and then invokes:

if (array) {
[array release];
}
array = [[NSArray alloc] initWithArray:[NSUnarchiver unarchiveObjectWithFile:file]];


But BBB crashes...

Maybe it is because "file" is busy and locked? I thought that "archiveRootObject" returns "YES" after successfully writing the data to disk? Is there any way to get around this? I tried waiting 3 secs before calling the reading process, but no change...

Or am I having another error?

Thank you for your help!

Best regards,

Stephan

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: using NSMutableDictionary in place of NSDictionary
  • Next by Date: How to Implement Finder - Search like functionality in my App
  • Previous by thread: Re: completely and utterly confused with NSImage + MySQL
  • Next by thread: How to Implement Finder - Search like functionality in my App
  • Index(es):
    • Date
    • Thread