Re: NSApplicationMain() doesn't set NSApp to my subclass
Re: NSApplicationMain() doesn't set NSApp to my subclass
- Subject: Re: NSApplicationMain() doesn't set NSApp to my subclass
- From: "John C. Randolph" <email@hidden>
- Date: Wed, 17 Aug 2005 14:05:06 -0700
On Aug 17, 2005, at 1:03 PM, Christopher Hickman wrote:
I have an app with a subclass of NSApplication, called
SWLApplication. I've
set the custom class of File's Owner in MainMenu.nib to my subclass
and I've
changed my principal class to SWLApplication in my application's
target in
Xcode, but when I run my app NSApplicationMain() doesn't initialize
the
NSApp global with an instance of my subclass. Instead, NSApp is an
NSApplication instance.
Am I missing a step somewhere?
Set the principle class for your application bundle. In
"Info.plist", change:
<key>NSPrincipalClass</key>
<string>NSApplication</string>
to:
<key>NSPrincipalClass</key>
<string>SWLApplication</string>
and that should get you squared away. I also would change the class
of "file's owner" in the main nib file, but I'm not sure that's
actually required.
-jcr
John C. Randolph <email@hidden> (408) 914-0013
Roaming Cocoa Engineer,
Available for your projects at great Expense and Inconvenience.
_______________________________________________
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