Re: NSApp problem outside of bundle
Re: NSApp problem outside of bundle
- Subject: Re: NSApp problem outside of bundle
- From: Peter Mulholland <email@hidden>
- Date: Mon, 29 Jun 2009 21:03:30 +0100
Hello,
> What's going on? What is NSApp trying to do that falls over when it's not in a bundle, or in another apps bundle on 10.4?
I've solved it. The problem was that [NSApplication sharedApplication] did not add the app to the Dock for some reason. The following code solves that:
ProcessSerialNumber psn;
GetCurrentProcess(&psn);
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
This is probably naughty, but it does work. I do this directly after the call to [NSApplication sharedApplication].
BTW Yes I know about kCurrentProcess. It doesn't work. Passing that to TransformProcessType() causes a crash.
--
Best regards,
Peter mailto:email@hidden
_______________________________________________
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