![](/img/trans.png)
[英]UITableViewController static cells not appearing when pushed to navigationController
[英]iOS - static cells not appearing in a subclass of UITableViewController
我知道static仅与UITableViewController
。 因此,我确实将Storyboard中的UITableViewController
拖放到了我的工作空间。 我添加了一些静态单元格,当我运行我的应用程序时,它们运行良好。 但是,如果我将故事板中的类更改为UITableViewController
自己的子类,则静态单元格消失。 我究竟做错了什么?
我整理了一下。 当创建UITableViewController
的子类时,Xcode会自动创建覆盖静态单元格数据的方法。 因此,您必须将这些注释掉:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.