2013-04-26 36 views
1

好的,我正在試圖使我的AppleScriptObjC應用程序中出現一張表格,該表格基於我已經在'Interface Builder'.xib文件中設計的面板。從AppleScriptObjC中的面板製作表格

我發現了一個奇妙的答案here,但它是Objective-C,我努力將它翻譯成AppleScriptObjC。

下面是我目前試過的代碼: beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo_(loadingWindow, mainWindow, me, missing value, missing value)

這只是給了我以下錯誤:

[AppDelegate titleRefresh:]: *** -[AppDelegate beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:]: unrecognized selector sent to object <AppDelegate @0x10323d4c0: OSAID(4)> (error -10000) 

原來的窗口被稱爲「主窗口」,要使用的面板作爲工作表被稱爲「loading窗口」。

如果有人能幫助我,那將是非常感謝!

回答

1

好吧,看起來我已經弄明白了。對於任何人有這個問題:

您需要使用如下代碼:

current application's NSApp's beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo_(loadingWindow, mainWindow, me, missing value, missing value) 

...您要使用的紙張是loadingWindow的面板,在主窗口(該表將出現在)是mainWindow

同樣,您可以通過使用此代碼關閉表:

current application's NSApp's endSheet_(loadingWindow) 
loadingWindow's orderOut_(loadingWindow) 

我希望這有助於有人在那裏! :)