2010-01-26 32 views
5

我正在使用TTLauncherView,因此我聲明視圖控制器爲TTViewController,就像在TTCatalog教程應用程序中一樣。在該視圖內聲明一個TTLauncherView var,添加項目等等。TTViewController和popupViewController方法

在我的應用程序的主要觀點是一個按鈕調用用下面的代碼之前的觀點:

-(void) switchToButtonOrderingView 
{ 
    ButtonOrderingViewController *ButtonOrderingView= 
    [[ButtonOrderingViewController alloc] initWithNibName:@"ButtonOrderingViewController" bundle:nil]; 
    self.ButtonOrderingViewController = ButtonOrderingView; 
    [self.view insertSubview:ButtonOrderingView.view atIndex:10]; 
} 

當我按下按鈕的應用剎車了,在這種方法屬於TTViewController.m:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    UIViewController* popup = [self popupViewController]; //brakes up here 
    if (popup) { 
    return [popup shouldAutorotateToInterfaceOrientation:interfaceOrientation]; 
    } else { 
    return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation]; 
    } 
} 

和誤差是這樣認爲:

[ButtonOrderingViewController popupViewController]:unrecog nized選擇器發送到實例

檢查以查看Three20類層次結構和TTViewController是UIViewController子類。

popupViewController是一個TTPopViewController(及其子類)方法!我不使用TTCatalog教程應用程序。我迷路了。任何幫助將不勝感激。

謝謝。

+0

很想得到這個迴應。我面臨同樣的問題。 – lostInTransit 2010-02-10 04:50:29

回答

8

有同樣的問題,發現錯誤!

這是根據Three20設置說明忘記將-ObjC和/或-all_load添加到其他鏈接器標誌時發生的情況。可能是因爲你將它們添加到了項目級別,並且在較低級別上進行了重寫設置 - 對我來說就是這種情況。

+0

請注意,如果您使用Objective-C編寫的第三方靜態庫,這是一個非常常見的問題。通過訪問http://developer.apple.com/mac/library/qa/qa2006/qa1490.html,您可以獲得關於這些標記所做的更多信息。 引用:「-ObjC標誌會導致鏈接器加載庫中定義Objective-C類或類別的每個對象文件。[...] -all_load標誌強制鏈接器加載所有對象文件它看到的歸檔文件,甚至沒有Objective-C代碼的文件。「 – 2010-07-24 19:25:26