gpt4 book ai didi

iOS - 静态单元格未出现在 UITableViewController 的子类中

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:35:49 25 4
gpt4 key购买 nike

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

最佳答案

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

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com