我的問題是我無法顯示具有靜態單元的UITableViewController的繼承類。我在UITableViewController中使用Storyboard進行簡單的自定義單元格設置(我想獲得設置應用程序的行爲)。但我需要將它嵌套在顯示自定義頂部欄的另一個UIViewController中(如導航欄面板)。所以,當我打開我的UITableViewController這種結構:繼承UITableViewController的正確方法?
#import <UIKit/UIKit.h>
@interface MyCoolTableVC : UITableViewController
@end
我沒有得到任何的問題,這是我在故事板製造商設置的所有定製單元都顯示在分組表視圖有道。但是,當我使用的子類的UITableViewController:
#import <UIKit/UIKit.h>
#import "MyCoolTableVCSubclass.h"
@interface MyCoolTableVC : MyCoolTableVCSubclass
@end
我得到這樣的結果:
它顯示的tableView的野生外觀,無節和自定義單元格。 我打開我的控制器使用此代碼,如果它可以幫助:
UIViewController *vcToGo = nil;
UIStoryboard *storyBoard = [[UIStoryboard storyboardWithName:@"MyCoolStoryboard" bundle:nil] init];
vcToGo = [storyBoard instantiateViewControllerWithIdentifier:@"profileTable"];
[self.navigationController pushViewController:vcToGo animated:YES];
謝謝你,問題是,我已經超重寫數據源的方法。 – kokoko 2012-03-28 15:43:03