[TableView] Warning once only: UITableView was told to layout its visible cells and other content...

[TableView] Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.g. table view bounds, trait collection, layout margins, safe area insets, etc), and will also cause unnecessary performance overhead due to extra layout passes. Make a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy to catch this in the debugger and see what caused this to occur, so you can avoid this action altogether if possible, or defer it until the table view has been added to a window. Table view: <UITableView: 0x7fe2ba8d5a00; frame = (-47 -80; 394 553); clipsToBounds = YES; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x600003447480>; layer = <CALayer: 0x600003aa2be0>; contentOffset: {0, 0}; contentSize: {394, 176}; adjustedContentInset: {0, 0, 0, 0}; dataSource: <Project.MondayToSundayViewController: 0x7fe2b9da05c0>>

我的错误场景:

tableview界面 push到二级界面pop回来后再viewWillAppear中使用 self.tableView.reloadRows(at: [IndexPath], with: UITableView.RowAnimation)
刷新了cell
根据多次测试,直接使用reloadData就没问题,具体原因未明待查

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容