开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜