1

一些用户报告说他们无法在我的沙盒应用程序中选择文件,因为当他们选择和项目时它会重新打开。

在我的代码中,我没有重新打开面板,所以我有点困惑为什么会发生这种情况。

我的一位用户说,控制台中多次记录了以下消息:

"Keychain sandbox consume extension error: s=-1 p= cannot allocate memory"

我已经要求他们对他们的钥匙串进行急救,并修复他们的磁盘权限,但这并没有帮助。

有没有人有任何想法可能导致这种情况?

谢谢!

下面是触发 NSOpenPanel 的代码:

- (IBAction)selectHomeDirectory:(id)sender {
  NSOpenPanel *openPanel = [NSOpenPanel openPanel];
  [openPanel setTitle:@"Select your home folder"];
  [openPanel setMessage:@"Select your home folder..."];
  [openPanel setPrompt:@"Choose"];
  [openPanel setCanCreateDirectories:NO];
  [openPanel setCanChooseFiles:NO];
  [openPanel setCanChooseDirectories:YES];
  [openPanel setExtensionHidden:YES];
  [openPanel setAllowedFileTypes:nil];
  [openPanel setAllowsMultipleSelection:NO];
  [openPanel setDelegate:self];
  [openPanel setDirectoryURL:[NSURL fileURLWithPath:@"/Users/"]];

  [openPanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
    if(result != NSOKButton || !openPanel.URL){
      return;
    }

    /* Saves the scoped URL, and then triggers a view change */
  }];
}
4

1 回答 1

0

This turned out to be a Mavericks issue that was fixed in the later seeds.

于 2013-10-31T17:37:41.663 回答