通过storyboard创建了静态单元格,但是没有显示,步骤如下,还望大神指正!
1.通过modal的方式进入tableViewController
2.注释了tableViewController内的数据源方法
3.在storyboard中关联了tableViewController
图片描述
[self presentViewController:[[TableViewController alloc] init] animated:YES completion:^{
}];
}
#pragma mark - Table view data source
//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
//#warning Incomplete implementation, return the number of sections
// return 0;
//}
//
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//#warning Incomplete implementation, return the number of rows
// return 0;
//}
/*
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
// Configure the cell...
return cell;
}
*/
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你的tableview 应该子类化封装一个controller里面了。那你之后就不该tableviewcontroller alloc 而是把你子类化的alloc
如果你storyBoard里边设置的控制器,那个控制器的类型必须也改成UITableViewController