Re: Programmatically setting Principle Class
Re: Programmatically setting Principle Class
- Subject: Re: Programmatically setting Principle Class
- From: Nick Zitzmann <email@hidden>
- Date: Thu, 3 Aug 2006 16:08:09 -0600
On Aug 3, 2006, at 3:36 PM, Shamyl Zakariya wrote:
The trouble is, to corral events I override NSApplication and use
my own sendEvent: method. If I can, I'd like to be able to
programmatically tell Cocoa to use *my* NSApplication subclass,
much like setting PrincipleClass in Info.plist does.
Is there a way to do this?
Maybe, by swizzling +[NSApplication sharedApplication] to return an
instance of your subclass instead before NSApplicationMain() is
called, but that's a bit of a hack and it may break things. It's much
easier just to set the NSPrincipalClass in each affected application.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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