O'Reilly logo

Xcode 4 Cookbook by Steven F. Daniel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required