Search code examples
iosnsarrayuisearchbaraqgridview

NSComparisonResult Returning Wrong Array


I have an instance of AQGridView laid out in a Pages-esque manner for the iPad. At the top of the grid, I've inserted a UIView with a UISearchbar. Instead of calling on a UISearchDisplayController, I've decided to take a page out of iBooks' playbook and use the search bar to filter the grid. But when it calls the delegate method to indicate a text change, my filtered array is returning the wrong result!

FACEPALM: I can't believe this: my datasource methods for the grid hadn't been updated to reflect the BOOL isSearching variable. The cell text would have always returned the result form the original array. This has been SOLVED, my apologies.

For the future: I've noticed there is no NSComparisonResult tag, and I don't have enough rep to make one!


Solution

  • FACEPALM: I can't believe this: my datasource methods for the grid hadn't been updated to reflect the BOOL isSearching variable. The cell text would have always returned the result form the original array. This has been SOLVED, my apologies.

    For the future: I've noticed there is no NSComparisonResult tag, and I don't have enough rep to make one!