View Full Version : UISearchBarController Not Loading Cells

Feb 19, 2012, 09:11 PM
Hey All,

so I have an app and one of the tabs shows the customers for the app. I'm using Core Data to store my data and using CoreDataTableViewController (http://www.stanford.edu/class/cs193p/cgi-bin/drupal/system/files/sample_code/CoreDataTableViewController_0.zip) (that's a zipped folder with the code for CoreDataTableViewController inside) from the stanford courses to help me use a NSFetchedResultsController to manage the table.

I'm using Xcode 4.2 and this is an iPad iOS 5 app. Everything is set up and working just fine in terms of adding/ modifying customers and having them show up in the table view fine.

I should mention as well that I'm using a custom cell, so I can have images and multiple labels etc.

I added a UISearchBarController in IB and added in the code to have a separate NSFetchedResultsController to be used for it. From putting in some NSLog calls I know I am setting that fetchedResultsController up properly, and it is getting filled properly, but the Search Table isn't being updated...

I put an NSLog call in to tableView:cellForRowAtIndexPath: and I'm creating the proper customer and filling the cell in properly, it just isn't being shown on the search display table...

Any ideas of what I'm doing wrong?

I should point out as well that I have all the uitableviewdatasource methods checking which table view is calling the method and then using the proper fetchedresultscontroller.

Also, I've noticed now to that if I type in some search query that shouldn't return anything, it does put "No Results" into the display. It just leaves the table blank when I type in some search query that should (and from my tests, does) return results.