使用 UITableView-FDTemplateLayoutCell庫做cell高度自適應,報錯:
NSAssert(templateCell != nil, @"Cell must be registered to table view for identifier - %@", identifier);
正常的原因是:沒有提前注冊tableviewCell。需要在reload之前,最好是初始化之后就提前根據id注冊cell。
當然也有不正常原因:你會發現注冊了cell還是一樣的報這個錯,那么你要檢查一下你有沒有把設置tableview的header或者footer的方法放在了注冊cell之前!!!比如說這樣子的代碼:
tableView.tableViewFooter = [UIView new];