NSDocument's canCloseDocumentWithDelegate:...
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