gpt4 book ai didi

ios - super viewdidload 给我一个不可见的@interface for uitableview 为选择器 viewdidload 声明

转载 作者:行者123 更新时间:2023-11-28 20:05:59 29 4
gpt4 key购买 nike

这是我当前的代码。我什至没有通过 viewDidLoad 方法覆盖,因为在它说 super viewdidload 的那一行它抛出错误 @interface for uitableview 为选择器 viewdidload 声明。

我不太熟悉 iPhone 开发,而且我还在起步阶段。有人可以帮我解决这个问题

我的代码

@interface myUITVC : UITableViewController UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, strong) NSMutableArray *array;

@end


@implementation myUITVC

-(void)viewDidLoad
{
[super viewDidLoad];
}

@end

最佳答案

  1. 如果您继承 UITableViewController(因为 UITableViewController 已声明它),则不必声明表委托(delegate)和数据源。

    改变

    @interface myUITVC : UITableViewController UITableViewDelegate, UITableViewDataSource>

    @interface myUITVC : UITableViewController
  2. 您在 viewDidLoad 中缺少大写“D”。

关于ios - super viewdidload 给我一个不可见的@interface for uitableview 为选择器 viewdidload 声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22110471/

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