0
我有一個函數來檢查chrome是否可以打開一個url。在iOS我有:如何在mac OS應用程序中使用canOpenURL?
// is chrome installed??
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"googlechrome://"]])
{
...
}
但現在在我的應用程序到Mac OS,我不能使用此,因爲是與NSWorkspace未申報的功能。
if ([[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"googlechrome://"]])
{
...
}
那麼,如何使用canOpenURL?