Re: NSApp's run method and menus...
Re: NSApp's run method and menus...
- Subject: Re: NSApp's run method and menus...
- From: "Jeff Bland" <email@hidden>
- Date: Tue, 17 Jul 2007 02:16:40 +0900
Regarding whether I should multithread, actually I am. For debugging
reasons, there's currently two versions of the application, the threaded one
and the threaded one (separated by #ifdefs) - that's how I found that it was
the threaded version calling [NSApp run] was the one with working menus.
As for the unthreaded version - I'm not calling NSApplicationLoad() - the
documentation seems to imply that you only need to call it when your working
with both Cocoa and Carbon (and as far as I know I'm only directly working
with Cocoa), but if it does the initialization I need then that would take
care of it. However, I've solved the problem: if I call [NSApp run], use a
delegate method to steal control from it, leaving it on there the stack, and
then put my event loop to work, everything works properly including the
menu's any anything else further along that would have been broken.
So the run method does a bunch of initialization (maybe even calling
NSApplicationLoad()) thats not specifically documented anywhere that I know
of - and once you call it you're free to grab and post events at your
leisure.
Thanks everyone for your help,
- Jeff Bland
_______________________________________________
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