title: tableView.reloadData() gets numberOfRowsInSection BUT NOT cellForRowAt (where count > 0)
body: <p>I am having a problem where I do tableView.reloadData()  - in Swift 3</p>
  
  <p>and as a result <strong>i get the numberOfRowsInSection callback, but I DO NOT get the cellForRowAt callback</strong>. Why would I get one callback and not the other when the number of rows is > 0 on the first call back?</p>
  
  <p><a href="https://stackoverflow.com/questions/41446920/cellforrowat-indexpath-is-not-being-called-with-reloaddata-method">related</a>    BUT i think that one is about not calling tableView.reloadData() at the tight time.  I am calling that function BUT only getting <strong>one</strong> of the two necessary callbacks.</p>
  
  <p>In my view did load I do</p>
  
  <pre><code>        tableView.dataSource = self
          tableView.delegate = self
  </code></pre>
  
  <p>so I have that all set up</p>
  
  <p>The table load has to wait on some reads so I am using a library called SwiftEventBus that is a wrapper for NotificationCenter</p>
  
  <p>I listen for a post in order to know it is time to reload the table. The listener is in the ViewController that contains the UITableView. 'eventMessage' is the named event that get posted via SwiftEventBus</p>
  
  <pre><code>        SwiftEventBus.onMainThread(self.target as AnyObject, name : eventMessage) { result in
  
              self.makeDisplayArray()
          }
  </code></pre>
  
  <p>The simplified makeDisplayArray function is as follows. Main thing is that it calls for the reload of the table.  I tried with and without the DispatchQueue and it makes no difference.</p>
  
  <pre><code>func makeDisplayArray() {
      //DispatchQueue.main.async {
          self.tableView.reloadData()
      //}
  }
  </code></pre>
  
  <p>The first time that I load from the database, I get the event message, then call reloadData() and the table loads (e.g. I get both numberOfRowsInSection callback, AND I get the cellForRowAt callback). All is well.</p>
  
  <p>The second time that I try to go through the same logic I get only the numberOfRowsInSection callback (with a non-zero number - I have rows to display)  BUT I do not get the cellForRowAt callback.</p>
  
  <p>I put print messages in both callbacks. Why would I get one of the callbacks and not the other.  If I am getting the numberOfRowsInSection then the table must be trying to load as asked, but then why no cellForRowAt  callback. This happens every time after the first time I pass through the logic.</p>
  
  <p><strong>Alternately</strong> - what is a better way to wait on data loads to trigger the table load?  It is not a simple, single read.  This load requires multiple reads (I am using Firebase so have to track completion of multiple async reads before I can issue the event POST to signal the view controller).  I could put all this read logic inside the view controller but prefer to have a separate call for dealing with the data access - which then requires some kind of class-to-class communication.</p>
  
  <p>==========================================================================</p>
  
  <p>Screen shot to respond to comment on making tableview background red as a test
  <a href="https://i.stack.imgur.com/iMfO1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iMfO1.jpg" alt="Where did my rows go?"></a></p>
  
  <p>Print debug messages from inside table callback methods </p>
  
  <p><strong>1st pass through logic</strong></p>
  
  <p>loading LIST table with 3 entries [print inside numberOfRowsInSection]</p>
  
  <p>enter cell for row at [the rest at all prints from inside cellForRowAt]</p>
  
  <p>----loading LIST table for row 0 with title Dad Groceries</p>
  
  <p>enter cell for row at</p>
  
  <p>----loading LIST table for row 1 with title Chloe Vaca Stuff</p>
  
  <p>enter cell for row at</p>
  
  <p>----loading LIST table for row 2 with title New List</p>
  
  <p><strong>2nd pass through same logic</strong></p>
  
  <p>loading LIST table with 3 entries [print inside numberOfRowsInSection]</p>
  
  <p>..??? now the cellForRowAt is not called.  No print messages except for non-zero return from the numberOfRowsInSection which looks at the same array as the cellForRoawAt.</p>