简体   繁体   中英

cellforrowatindexpath not called after reloaddata swift

If I'm managing getting the data inside TableViewController, everything works perfectly, but as I want to move logic outside VC, when I'm triggering reloadData() from outside VC it is not calling cellForRowAtIndexPath and I data is not visible in the table. But numberOfSectionsInTableView or numberOfRowsInSection are being called, what is interesting. I tried many things: triggering reloadData on the main thread, property observers, Notification Center, but nothing seems to work, cellForRowAtIndexPath is never called.

so when you initialize the TableView, you should add

tableView.datasource = self;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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