Re: Documents not opening from Finder
Re: Documents not opening from Finder
- Subject: Re: Documents not opening from Finder
- From: Kyle Sluder <email@hidden>
- Date: Sat, 02 Mar 2013 13:41:05 -0800
On Mar 2, 2013, at 1:17 PM, "Mills, Steve" <email@hidden> wrote:
> On Mar 2, 2013, at 15:06, "Kyle Sluder" <email@hidden> wrote:
>
>> The documentation is pretty clear about how NSDocument's default implementation works. -[NSDocument runModalPrintOperation:delegate:didPrintSelector:context:] is what actually messages the delegate with the didPrintSelector. As long as you are calling that method with those arguments (either directly or by calling super in your override of -printDocumentWithSettings…), the delegate will be messaged appropriately.
>
> But I'm not calling runModalPrintOperation, nor do I want to, because we need to do something completely different at this point.
That's relevant information that you should really mention upfront.
> This is the reason I'm overriding printDocumentWithSettings in the first place. I just need to know how to call the selector like I stated before.
There are two ways:
1. Cast objc_msgSend to (void)(id, SEL, id, BOOL, void*) and call it with the correct arguments.
2. Build an NSInvocation and invoke it. You will probably want to create a dummy implementation of the didPrintSelector so you can get its method signature via -methodSignatureForSelector:.
--Kyle Sluder
_______________________________________________
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