Re: Programmatically setting Principle Class
Re: Programmatically setting Principle Class
- Subject: Re: Programmatically setting Principle Class
- From: Shamyl Zakariya <email@hidden>
- Date: Fri, 4 Aug 2006 10:54:17 -0400
But the problem here is that I want this to be usable from command-
line C++ apps -- like GLUT does. I can't set the principle class in
an info.plist when the app's not a .app bundle.
Also, the documentation basically says "Don't override [NSApplication
sharedApplication]"...
email@hidden
"Such a theory has to be bizarre and elaborate, as well as being
stupid"
-- Jim Loy, regarding a hollow earth
On Aug 3, 2006, at 6:08 PM, Nick Zitzmann wrote:
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