• 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
Saving while opening with NSDocument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Saving while opening with NSDocument
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Finder Tags API
  • Next by Date: menuNeedsUpdate for key equivalents?
  • Previous by thread: Finder Tags API
  • Next by thread: Re: Saving while opening with NSDocument
  • Index(es):
    • Date
    • Thread