How to get NSAlert sheet to return focus to calling window?
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 does开发者_运维知识库n't return focus to System Preferences. Any ideas?
Try sending that window a -makeKeyAndOrderFront:
message at the end of your -unsavedChangesAlertDidEnd:returnCode:contextInfo:
method.
精彩评论