繁体   English   中英

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

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM