• 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
Re: NSDocument subclass can only be opened once
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocument subclass can only be opened once


  • Subject: Re: NSDocument subclass can only be opened once
  • From: Michael Starke <email@hidden>
  • Date: Thu, 23 Jan 2014 12:26:56 +0100

To simply test if the document really get's closed implement the close method in your NSDocument subclass. If it get's called, your document will be closed.

- (void)close {
  [super close];
}

This should get called, if you do not have anything else interfering implemented (eg. canCloseDocumentWithDelegate). Stack trace for this call is in my case

-[MPDocument close] at **/MPDocument.m:200
-[NSWindowController _windowDidClose] ()
-[NSWindow _close] ()
-[NSDocument _something:didSomething:soContinue:] ()
__75-[NSDocument canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:]_block_invoke_2 ()
__75-[NSDocument canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:]_block_invoke ()
-[NSDocument performActivityWithSynchronousWaiting:usingBlock:cancellationHandler:] ()
-[NSDocument canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:] ()
-[NSWindow __close] ()
-[NSWindow _close:] ()
-[NSApplication sendAction:to:from:] ()
-[NSControl sendAction:to:] ()
-[NSCell _sendActionFrom:] ()
-[NSCell trackMouse:inRect:ofView:untilMouseUp:] ()
-[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] ()
-[NSControl mouseDown:] ()
-[_NSThemeWidget mouseDown:] ()
-[NSWindow sendEvent:] ()
-[NSApplication sendEvent:] ()
-[NSApplication run] ()
NSApplicationMain ()


On 23 Jan 2014, at 12:09, Graham Cox <email@hidden> wrote:

>
> On 23 Jan 2014, at 9:44 pm, SevenBits <email@hidden> wrote:
>
>> Pressing the Close button closes the window
>
>
> Yes, but does it close the document? i.e. remove it from the list of open documents and releases the document object? The document is not the window.
>
> --Graham
> _______________________________________________
>
> 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


___m i c h a e l   s t a r k e____
       geschäftsführer
       HicknHack Software GmbH
       www.hicknhack-software.com

___k o n t a k t____
       +49 (170) 3686136
       email@hidden

___H i c k n H a c k   S o f t w a r e   G m b H____
       geschäftsführer - maik lathan | andreas reischuck | michael starke
       bayreuther straße 32
       01187 dresden
       amtsgericht dresden HRB 30351
       sitz - dresden


_______________________________________________

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


References: 
 >Re: NSDocument subclass can only be opened once (From: Graham Cox <email@hidden>)
 >Re: NSDocument subclass can only be opened once (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: NSDocument subclass can only be opened once
  • Next by Date: Re: How to choose different implementations of an object method at runtime?
  • Previous by thread: Re: NSDocument subclass can only be opened once
  • Next by thread: Re: Priority MOC operations?
  • Index(es):
    • Date
    • Thread