Filtering and searching for data within a Table View

In this recipe we will learn how to search through our Table View to filter list items.

Getting ready

Following on from our previous recipe, we will learn how to use the UISearchBar control to allow us to filter and narrow down the results of our book details.

How to do it...

To begin, follow these simple steps as outlined in the following order:

  1. Select the MainStoryboard.storyboard file from the Project Navigator window.
  2. From Object Library, select and drag a (UISearchBar) Search Bar and Search Display Controller control to the top of the navigation bar of our (UITableViewController) control that we added in previous steps.
  3. Next, create the outlet method for the search bar and name it filteredResults ...

Get Xcode 4 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.