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