I have an OS X prefpane that calls a NSAlert sheet with:
[alert beginSheetModalForWindow:[[self mainView] window] modalDelegate:self didEndSelector:@selector(unsavedChangesAlertDidEnd:returnCode:contextInfo:) contextInfo:nil];
Which shows the alert sheet attached to the System Preferences application fine, but when I click the sheet's OK button, it closes and doesn't return focus to System Preferences. Any ideas?