美文网首页
iOS dequeueReusableCellWithIdent

iOS dequeueReusableCellWithIdent

作者: KeyboardDirver | 来源:发表于2019-05-13 18:14 被阅读0次

今天发现一个崩溃,在dequeueReusableCellWithIdentifier,崩溃日志上提示必须先resgist一个cell。如下
、、、
unable to dequeue a cell with identifier AddAddressCellIdentify - must register a nib or a class for the identifier or connect a prototype cell in a storyboard
-[AddAddressVC tableView:cellForRowAtIndexPath:] (AddAddressVC.m:)
、、、

这个崩溃是有前提的
1.iOS8系统 (我的是iphone6)
2.tableview是UITableViewStylePlain类型
3.tableview的懒加载中
先设置 _listTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];

_listTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
然后注册cell

修改方法把cell注册放在_listTableView.separatorStyle = UITableViewCellSeparatorStyleNone;前面

相关文章

网友评论

      本文标题:iOS dequeueReusableCellWithIdent

      本文链接:https://www.haomeiwen.com/subject/dlbraqtx.html