Problem getting the launch identifier
Problem getting the launch identifier
- Subject: Problem getting the launch identifier
- From: Craig Altenburg <email@hidden>
- Date: Thu, 25 May 2006 16:00:28 -0400
I am trying to launch a faceless, background-only application and get
back the launch identifier using:
NSNumber * launchIdentifier = nil;
BOOL launchOK = [ [ NSWorkspace sharedWorkspace ]
launchAppWithBundleIdentifier: @"com.mindwrap.scripthelper"
options: 0
additionalEventParamDescriptor: nil
launchIdentifier: &launchIdentifier ];
NSLog( @"launchIdentifier = %@", launchIdentifier );
The requested application IS launched but the method call fails with
an NSRangeExcption:
*** -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)
The "NSLog" statement is not reached.
Oddly, if I pass nil in the launchIdentifier parameter the code works
(but, of course, does not return the launch identifier).
Is there some magic that I'm overlooking here?
I'm using XCode 2.3 on OS X 10.4.6 (intel).
Things I've tried that did not help:
* passing [ NSAppleEventDescriptor nullDescriptor ] as the
additionalEventParamDescriptor
* initializing the launchIdentifier variable with an NSNumber object
* setting options to: NSWorkspaceLaunchWithoutActivation
* consulting my crystal ball or ouija mouse pad
_______________________________________________
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