cellForAtIndexPath was not called in ViewDidLoad()?
Hello Everybody,
I have made a simple Cat App thats parsing by NSXMLParserDelegate protocol a XML file from public API and shows photos of cats in a TableView. It works fine, but I am trying some refactoring. I have made a CatsDataSource as! NSObject class when it does parsing and calling tableView functions which are part of UITableViewDataSource. I have put in my main ViewController an instance of CatsDataSource class and set my IBOutlet catsTableView.dataSource = instance of CatsDataSource , also for delegate. It works but partially. Only when I call reloadData() from a random function, which is a function that randomize cats pictures in the tableView.
I have found that tableView cellForRowAtIndexPath func was not called at all in ViewDidLoad(). It’s only called when click random function.(which is IBAction func.)
Thnaks.
Bojan
Mac mini (Late 2014), iOS 9.3.1, Swift