[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
根據(jù)多次測試,直接使用reloadData就沒問題,具體原因未明待查