• 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: Launch with bundle fails the first time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Launch with bundle fails the first time


  • Subject: Re: Launch with bundle fails the first time
  • From: Nir Soffer <email@hidden>
  • Date: Sat, 9 Dec 2006 20:10:09 +0200


On Dec 8, 2006, at 13:29, Trygve Inda wrote:

Have you tried launching your subapp with -launchApplication:?

sherm--

Yes, but I lose the ability to add extra parameters:

How about launching the executable itself with NSTask and passing parameters in the arguments?


NSString *helperPath = [[NSBundle mainBundle] pathForResource:@"Helper"
ofType:@"app"];


    NSBundle *helperBundle = [NSBundle bundleWithPath: helperPath];

    [NSTask launchedTaskWithLaunchPath:[helperBundle executablePath]
                             arguments:[NSArray arrayWithObjects:...]];

Since you control the helper app, relying on its name is good enough. Also, you don't want launch services to locate another copy with the wrong version, you want the copy inside the current bundle.


Best Regards,

Nir Soffer

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >Re: Launch with bundle fails the first time (From: Trygve Inda <email@hidden>)

  • Prev by Date: Re: Launch with bundle fails the first time
  • Next by Date: Re: NSTextView Not Drawing Text
  • Previous by thread: Re: Launch with bundle fails the first time
  • Next by thread: Re: Launch with bundle fails the first time
  • Index(es):
    • Date
    • Thread