Re: Debugging Plugins
Re: Debugging Plugins
- Subject: Re: Debugging Plugins
- From: Shaun Wexler <email@hidden>
- Date: Fri, 19 Sep 2003 22:23:29 -0700
On Sep 19, 2003, at 5:28 PM, Eric Wang wrote:
This sounds like a great way to architect a document-based application.
Would you mind elaborating on how you achieved this? What methods did
you
have to add/override in your NSDocumentController and NSApplication
subclasses?
I added a category to NSDocumentController, with a method to return the
private _types array, and another to add any new types by replacing
that array with a new copy. My subclass overrides
-documentClassForType: to post a notification when an unknown class is
encountered, and the -openDocument method to present a multi-doc open
panel when asked to create a new document. There are several added
methods to support my plug-in scheme as well as KVC/KVO compliance. To
allow double-clicking plug-ins in the Finder, I created a sole document
type for the app itself, which triggers a proxy document class which
just uses -readFromFile:ofType: to load the plug-ins, and then goes
away. The application subclass manages all plug-in registration and
activation, and tracks which classes belong to which plugins. With the
new controller layer in Panther, subclassing NSApplication is much more
useful than it used to be. It's amazing how well this new app
structure came together, with little effort, and minimal coding. Maybe
I should write a paper? Or sell some software... ;)
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.