2013-04-10 83 views

回答

0

的 「下拉列表對話框」 被稱爲表,可以是一個NSWindow。

的方法,讓他們展示了可以修改的NSApplication中找到:beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:

一個超級簡單的實現看起來是這個樣子:

NSWindowController *sheet = [[NSWindowController alloc] initWithWindowNibName:@"Sheet"]; 

[NSApp beginSheet: sheet.window 
    modalForWindow: self.view.window // The window from where the sheet will appear 
    modalDelegate: self 
    didEndSelector: nil // Optional @selector(didEndSheet:returnCode:contextInfo:) 
     contextInfo: nil];