NSUnarchiver: How to deal with locked file?
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