2013-08-04 193 views
1

後,我添加了這兩個出口到我的AppController.jCPWindow被封鎖關閉CPPanel

@outlet CPWindow theWindow; 
@outlet CPWindow thePanel; 

theWindow充滿整個瀏覽器窗口(setFullPlatformWindow:YES)。

現在我使用的是CPToolbarItem(內CPToolbar我加入theWindow)上點擊進行這種方法:

- (IBAction)showPanel:(id)aSender { 

    // ... 
    [CPApp runModalForWindow:thePanel]; 
} 

我創建在Interface Builder所有這些UI元素。

當我關閉thePanel時,theWindow似乎卡住了 - 無法單擊按鈕或以任何其他方式與theWindow中的元素進行交互。

這裏怎麼回事?

回答

2

很可能您並未成功解散您的面板,因此其模態仍保持活動狀態。試試這個代碼負責關閉你的面板:

[CPApp abortModal]; 
[thePanel close]; 
+0

謝謝,它現在工作!我沒有現在我甚至不用編程關閉面板,而是使用面板的默認關閉按鈕。 – Patrick