Re: Launching an App, within an app.. :)
Re: Launching an App, within an app.. :)
- Subject: Re: Launching an App, within an app.. :)
- From: Gregory Weston <email@hidden>
- Date: Sun, 18 Jun 2006 07:00:17 -0400
Bobby Bm wrote:
Hey guys;
I want to include an .app in my application, in addition to the normal
.app. Like, it would be in my .app's /Resources. I'm having trouble
launching the app though. I know how to use pathForResources, but I
have trouble with this:
[[NSWorkspace sharedWorkspace] launchApplication:@"Dashboard"];
(I'm not trying to launch Dashboard, lol). When I pass it the path to
the app, it just doesn't load... Should I try another approach? Any
suggestions?
Best guess is that you're not actually sending the correct path. If
you've put a bundled application in your resources folder, you'd want
to do this:
NSBundle* theBundle = [NSBundle mainBundle];
if(theBundle)
{
NSString* thePath = [theBundle pathForResource:@"MyHelper"
ofType:@"app"];
if(thePath)
{
if([[NSWorkspace sharedWorkspace] launchApplication:thePath]
== NO)
{
NSLog(@"Unable to launch %@.", thePath);
}
}
}
_______________________________________________
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