• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Launching an App, within an app.. :)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: How to make a dictionary for Dictionary.app
  • Next by Date: Re: Trouble with sheets...
  • Previous by thread: Re: Launching an App, within an app.. :)
  • Next by thread: Trouble with sheets...
  • Index(es):
    • Date
    • Thread