2013-04-26 53 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) 

我希望这有助于有人在那里! :)