Saving while opening with NSDocument
Saving while opening with NSDocument
- Subject: Saving while opening with NSDocument
- From: Colas B <email@hidden>
- Date: Tue, 11 Mar 2014 17:24:52 +0000 (GMT)
Hi (this is my first email on the Apple mailing list) ;-)
I would like to perform `saveDocument:` in the process of opening a document (I call this method in `- (id)initWithContentsOfURL:ofType:error:`.
It does not work because of a deadlock.
I would like to know if you have any idea about that.
PS: I also tried to override `(id)makeDocumentWithContentsOfURL:ofType:error:` and `- (void)openDocumentWithContentsOfURL:display:completionHandler:` (for this purpose, I subclass NSDocumentController. I have tried to call `saveDocument:` in "windowDidLoad". All lead to the same deadlock.
PPS: Why do I want to do that? When a document is opened, sometimes some corrupted data needs to be fixed. I do it, but I want to save these fixes. So that the user won't remark anything.
PPS: My document handles "additionalData" (file wrapper), but this should not change anything.
Thanks
Colas
`
_______________________________________________
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