Problems with custom handling of open AppleEvent
Problems with custom handling of open AppleEvent
- Subject: Problems with custom handling of open AppleEvent
- From: "Sean McBride" <email@hidden>
- Date: Tue, 2 Dec 2008 18:49:20 -0500
- Organization: Rogue Research
Hi all,
I have a document-based app. Doc opening is working well.
Now my app also needs to be able to open .foo files. However, these are
not document files, and there is no NSDocument subclass related to
them. I want to treat .foo files specially (show a special window), and
let Cocoa handle other files as it normally does. But how...?
I've tried:
1) Subclassing NSDocumentController and implementing
openDocumentWithContentsOfURL:display:error:. This almost works
perfectly. I can detect .foo files and do my special handling, but when
I return nil, Cocoa 'helpfully' displays a generic error message, which
I do not want. Even overriding willPresentError: to return nil doesn't
suppress the alert.
2) I could install my own handler for the open AppleEvent, and
handle .foo properly, but how can I let Cocoa handle other files
normally? There doesn't seem to be a way to get the current handler,
for me to delegate to.
I hope I'm missing something easy...
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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