views:

11

answers:

0

I have a table view controller (VC1) which has a list of items. When people click on the items, they are taken to a view controller where they can edit them (VC2). VC1 also has the ability to search through the items, and I've built this using a UISearchController and NSFetchedResultsController. It works fine for searching, but I run into a very strange bug:

  1. Search for an item
  2. Edit the item
  3. Return to the main screen (VC1)
  4. Leave the search mode

When I come to the end of this process, the view controller has expanded to have the right number of items (i.e. it's not only the search results), and it shows the first 10 or so, however many fit on the iPhone's screen. But when I scroll down, all the other table cells are blank! I am making sure to call [self.tableView reloadData] but it isn't calling the function tableView:cellForRowAtIndexPath: to configure each cell. Any ideas what might be causing this strange error?