首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

UITabBar 和獨立的 UItableView 問題?这个有关问题俺也遇到了

2012-09-02 
UITabBar 和獨立的 UItableView 問題?这个问题俺也遇到了用TabView時,每一個Tab各自獨立指定xib,碰到 Tabl

UITabBar 和獨立的 UItableView 問題?这个问题俺也遇到了

用TabView時,每一個Tab各自獨立指定xib,碰到 TableView不知道為甚麼就是有問題
現在 mainwindow ?在 IB 大概是這樣:
Tab Bar Controller
|-Navigation Controller
|-Navigation Controller
...
|-Navigation Controller
?? |-Navigation Bar
?? |-View Controller(NIB name 設定成 MyTableView)
??????|-Navigation Item
?? |-Tab Bar Item

MyTableView是:
|-File's Owner (指定 MyTableViewController)
|-View
?? |-TableView(DataSource 和 Delegate 指向 Files's Owner)

MyTableViewController:UIViewController <UITableViewDelegate, UITableViewDataSource>
然後寫了
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView??
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
三個函數

執行時卻出現這個例外:
** -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x25329f0
都已經定義了,不知道為甚麼有這錯誤
如果不分開,都寫在 MainWindow就可以
麻煩大家解答了, thanks

?

?

解决方法

?????????????? |-View Controller(NIB name 設定成 MyTableView) 這裡要指定 class

热点排行