Question

I'm pretty much ready to release the first sandbox-enabled Mac application. The only entitlement that I need is User Selected File. The user clicks on a toolbar button to select one or more image files, which doesn't cause trouble. The user also clicks on a button to select a folder. When they do, the Xcode output window indicates the following error message. CGSSetIgnoresCycle: error 1000 setting or clearing window tags. If the user cancels the select-folder operation without selecting one, they get an additional error message on top of the first one. It says PSsetwindowlevel, error setting window level (1000). The application does not crash. Are these error messages things that I need to worry? If I ask Google, I don't get many search results. Anyway, the following code is used when the user clicks on a button to select a folder.

- (IBAction)system1Selected:(id)sender {
    NSOpenPanel *panel = [NSOpenPanel openPanel];
    [panel setAllowsMultipleSelection:NO];
    [panel setCanChooseDirectories:YES];
    [panel setCanChooseFiles:NO];
    NSString *currentpath = systempath1.stringValue;
    if ([self fileExists:currentpath]) {
        [panel setDirectoryURL:[NSURL fileURLWithPath:currentpath]];
    } else {
        [panel setDirectoryURL:[NSURL fileURLWithPath:[self filePathA]]];
    }
    if ([panel runModal] != NSFileHandlingPanelOKButton) {
        //return nil;
    } else {
        NSURL *url = [[panel URLs] lastObject];
        systempath1.stringValue = [url path];
    }
}

Thank you for your advice.

Was it helpful?

Solution

This error has been there for a while in all my applications. It doesn't seem something you need to worry about. It disappears without changing anything and, probably, it depends on a bug of the NSOpenPanel (I didn't manage to get the same error using the NSSavePanel).

In my opinion, there's no need to investigate further.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top