• 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
NSDocument's canCloseDocumentWithDelegate:...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDocument's canCloseDocumentWithDelegate:...


  • Subject: NSDocument's canCloseDocumentWithDelegate:...
  • From: Seth Willits <email@hidden>
  • Date: Wed, 25 May 2005 15:55:42 -0700

On May 13, 2005, at 11:13 AM, Seth Willits wrote:

The bigger problem though is that this is hanging my application up, not that it isn't releasing the document. The application simply won't quit, which I believe is a result of the document not being properly released by the NSDocumentController for some reason. If I had a tech support incident I'd probably use it on this.


To bring this back up, I found this happening in another project and I think I'm misunderstanding how this works. Shouldn't the code below cause the document to close?


- (void)canCloseDocumentWithDelegate:(id)delegate shouldCloseSelector: (SEL)shouldCloseSelector contextInfo:(void *)contextInfo
{
NSInvocation * invocation = [[NSInvocation alloc] init];
BOOL shouldClose = YES;


    [invocation setTarget:delegate];
    [invocation setSelector:shouldCloseSelector];
    [invocation setArgument:&self atIndex:2];
    [invocation setArgument:&shouldClose atIndex:3];
    [invocation setArgument:contextInfo atIndex:4];
    [invocation invoke];
}


Trying to invoke:
- (void)document:(NSDocument *)doc shouldClose:(BOOL)shouldClose contextInfo:(void *)contextInfo



What happens is, if the document is unsaved and I try to quit the app, it just hangs there, doing nothing. I've play with all combinations of pointers to the different arguments as I wasn't exactly sure if I them correct, but no matter what I do it's the same result.



Any help would be appreciated,



--
Seth Willits

_______________________________________________
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


References: 
 >Document Unreleased Only When Quitting (From: Seth Willits <email@hidden>)
 >Re: Document Unreleased Only When Quitting (From: Seth Willits <email@hidden>)

  • Prev by Date: Re: Odd WebView Bhaviour
  • Next by Date: Re: Grouping undo-able actions with CoreData [SOLVED!]
  • Previous by thread: Re: Document Unreleased Only When Quitting
  • Next by thread: Getting keydown events during a drag
  • Index(es):
    • Date
    • Thread