Xcode 如何通过COCOA应用在safari上加载URL

Xcode 如何通过COCOA应用在safari上加载URL,xcode,cocoa,safari,Xcode,Cocoa,Safari,我只需要通过cocoa应用程序在Safari上加载URL。如果假设我的url是安全的,那么我希望打开带有密钥链访问中可用的证书的url。如何在safari上使用该证书(在keychain access中提供)加载url。现在我在safari上加载url时手动选择证书选择是不断询问多次,但它没有加载 我的代码是: NSURL *url = [NSURL URLWithString:@“http://www.google.com”]; NSDictionary *theProperti

我只需要通过cocoa应用程序在Safari上加载URL。如果假设我的url是安全的,那么我希望打开带有密钥链访问中可用的证书的url。如何在safari上使用该证书(在keychain access中提供)加载url。现在我在safari上加载url时手动选择证书选择是不断询问多次,但它没有加载

我的代码是:

   NSURL *url = [NSURL URLWithString:@“http://www.google.com”];

   NSDictionary *theProperties = [NSDictionary dictionaryWithObject:url forKey:@"URL"];
   SafariApplication* sfApp = [SBApplication applicationWithBundleIdentifier:@"com.apple.Safari"];
   SafariDocument *doc = [[[sfApp classForScriptingClass:@“document"] alloc] initWithProperties:theProperties];
   [[sfApp documents] addObject:doc];
谢谢:)