Re: Core Data Persistent Store Corrupted
Re: Core Data Persistent Store Corrupted
- Subject: Re: Core Data Persistent Store Corrupted
- From: Vladislav Struhar <email@hidden>
- Date: Sat, 20 Jun 2009 15:31:05 +0200
Actually I took a look at the file with HexEdit, that the file is
really corrupted! The header was different than the one from good file!
Now how can this happen with saving managed object contex? I'm always
saving in main thread...
The only thing I've found in my code, is that I missed two inverse
relationships. But could this be the reason of file corruption?
Thanks,
Vlado
Sent from my iPhone
On 20.6.2009, at 14:43, Jerry Krinock <email@hidden> wrote:
On 2009 Jun 17, at 05:43, Vladislav Struhar wrote:
I'm using Core Data model with NSBinaryStoreType persistent store.
Wow. I've never seen that actually used in real life.
After a long time of using this with no issues, I have encountered
an error:
"The file could not be opened because it is not in the right format."
File is about 1MB size. Do you know what might be the cause of
this? Is there a way to check/repair persistent store file?
No, but I can advise you to remember that NSErrors like that are
generated in response to an unexpected event, and if the unexpected
event was an "unknown unknown" to the person who wrote the code
generating the NSError, the root cause may not be what it says.
I've definitely seen that happen with the message you quoted above.
If I recall correctly, Core Data not finding your managed object
model is one of them. So, take a broader look, beyond just that file.
Also, if you are only seeing that message in a sheet in a window,
you're not getting all of the information. Intercept the NSError by
overriding -willPresentError:, and NSLog its entire userInfo
dictionary.
_______________________________________________
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
_______________________________________________
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