我有一个 UIViewController,我试图从中加载 2 个 UITableViews。
我有一个名为 FirstTableViewController 的类,它是UITableViewController
. 我已经尝试了以下代码,它运行时没有错误或警告
ViewController.m
UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 460.
style:UITableViewStylePlain];
[self.view addSubview:tableView];
现在,我尝试使用这段代码
ViewController.m
FirstTableViewController *tableView1 = [[FirstTableViewController alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 460.0) style:UITableViewStylePlain];
[self.view addSubview:tableView1];
我收到以下错误消息。
No visible @interface for 'FirstTableViewController' declares the selector 'initWithFrame:style:'
为什么此代码适用于UITableView
类并在其子类中失败。