以下はターミナルから動作します:
open -a cyberduck ftp://anonymous@mirror.switch.ch/mirror
FTP サイトを開き、引数を処理中であることを示します。
しかし、次のコードはそうではありません。Cyberduck は正常に開きますが、その引数は無視します。
[[NSWorkspace sharedWorkspace] launchApplicationAtURL:
[NSURL fileURLWithPath:@"/Applications/Cyberduck.app"]
options:NSWorkspaceLaunchDefault
configuration:[NSDictionary dictionaryWithObject:
[NSArray arrayWithObject:@"ftp://anonymous@mirror.switch.ch/mirror"]
forKey:NSWorkspaceLaunchConfigurationArguments]
error:&error];
戻ったとき、エラーはゼロです。
これはライオンにあります。引数がファイル名ではないため、openFile:withApplication: を使用できません。(私は試した。)
これは機能します。私はそれを使用する傾向があります。
system("open -a cyberduck ftp://anonymous@mirror.switch.ch/mirror");
何か案は?