Mac App Store に送信する前にアプリをサンドボックス化しようとしていますが、dmg ファイルを開く必要があります。以下を試してみましたが、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];
フルパスを端末に貼り付けると機能しますが、アプリから実行すると次のエラーが発生します。
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.
助けてくれてありがとう!S.