NSInteger error = SBSLaunchApplicationWithIdentifier((CFStringRef)bundleID, NO);
NSLog(@"launching [%@] error: [%d]", bundleName, error);
if (error) {
CFStringRef errorStr = SBSApplicationLaunchingErrorString(error);
DLog(@"launching %@ error to string [%@]", bundleName, (NSString *)errorStr);
CFRelease(errorStr);
}
I use the above code to launch my second application from my first application, mostly it can launch successfully. However, SOMETIMES it fails to launch. I see this error on syslog
launching [myFirstApp] error: [7]
launching myFirstApp error to string [application not found]
How can I always launch the application?
Note that my first application is running as a daemon