I am trying to isolate my application before sending it to the Mac App repository and I need to open the dmg file. I tried the following, but I do not know if it should work with Apple Sandbox.
NSTask *task = [[NSTask alloc] init]; [task setLaunchPath: @"/usr/bin/hdiutil"]; [task setArguments: [NSArray arrayWithObjects: @"attach", [NSString stringWithFormat:@"%@/myfile.dmg", documentsDirectory], nil]]; [task launch]; [task waitUntilExit]; if (0 != [task terminationStatus]) NSLog(@"Mount failed."); [task release];
If I insert the full path into the terminal, it works, if I run the application, I get the following error:
diskimages-helper[11437:303] ERROR: couldn't connect to framework. diskimages-helper[11437:303] DIHelper: setupConnectionToFrameworkWithUUID: failed hdiutil: attach failed - No child processes Mount failed.
Thanks for any help! S.
source share