My Mac app is designed to edit and analyse graphs, which users can create and store in files anywhere on the file system. I go to user to let them open a previously created file with [NSOpenPanel openPanel]
and an inline completion handler block. During the menu processing I get this console error message several times:
2017-02-25 13:42:47.394433 pasteurnet3[32901:1263849] [default] Failed to updated bookmark for item (null) [60AF512E-6072-427D-8624-C406B0EF7D5A] - URL:file:///AirDrop with error Error Domain=NSCocoaErrorDomain Code=260 "The file couldn’t be opened because it doesn’t exist."
This happens just in the creation of the NSOpenPanel
, even before sending it the beginWithCompletionHandler:
message. FWIW, the menu nonetheless does comes up when eventually requested, allows file selection, and otherwise seems to work. There does seem to be a long delay in the initialisation of the menu object.
I haven't paid attention to this app in a long time but the appearance of the message apparently owes to a MacOS change. I immediately suspected sandboxing, but sandboxing was turned off for the app. If I turn on sandboxing and request the "User-selected file" entitlement it seems to make no difference.
There is nothing special about the object creation except it is done inside a @try
block:
@try {
// Create the File Open Dialog class.
openDialog_ = [NSOpenPanel openPanel]; // error occurs here
}
@catch (NSException *e){
NSLog(@"innocuous exception(1) in -initForOpenWithDefaultFile:callBackTo:");
}
@catch (NSString *s){
NSLog(@"innocuous exception(2) in -initForOpenWithDefaultFile:callBackTo: \"%@\"", s);
}
@catch (...) {
NSLog(@"innocuous exception(3) in -initForOpenWithDefaultFile:callBackTo: probably a layout error");
}
@finally {
;
}
I am not doing anything with bookmarks from within the program nor, for that matter, with AirDrop.
Xcode 8.2.1, Macbook MacOS 10.12.3.