2

以下はターミナルから動作します:

open -a cyberduck ftp://anonymous@mirror.switch.ch/mirror

FTP サイトを開き、引数を処理中であることを示します。

しかし、次のコードはそうではありません。Cyber​​duck は正常に開きますが、その引数は無視します。

[[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");

何か案は?

4

1 に答える 1

0

ワークスペースにopenURLs:withAppBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifiers:メッセージを送ることをお勧めします。

于 2012-02-24T05:41:52.850 に答える