OGeek|极客世界-中国程序员成长平台

标题: iOS - 静态单元格未出现在 UITableViewController 的子类中 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 20:00
标题: iOS - 静态单元格未出现在 UITableViewController 的子类中

我知道静态只适用于 UITableViewController。所以我将 Storyboard 中的 UITableViewController 拖放到我的工作空间。我添加了一些静态单元格,当我运行我的应用程序时它们工作正常。但是,如果我将类(在 Storyboard 中)更改为我自己的 UITableViewController 子类 - 静态单元格就会消失。我做错了什么?



Best Answer-推荐答案


我整理好了。当您创建 UITableViewController 的子类时,Xcode 会自动创建覆盖静态单元格数据的方法。所以你必须把这些注释掉:

- (NSInteger)numberOfSectionsInTableViewUITableView *)tableView
- (NSInteger)tableViewUITableView *)tableView numberOfRowsInSectionNSInteger)section
- (UITableViewCell *)tableViewUITableView *)tableView cellForRowAtIndexPathNSIndexPath *)indexPath

关于iOS - 静态单元格未出现在 UITableViewController 的子类中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22329086/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4