iOS Reference Library Apple Developer
Search

ToolbarSearch

Last Revision:
Version 1.3, 2010-04-19
viewDidUnload now releases IBOutlets, added localization support, fixed rotation layout bug.
(Full Revision History)
Build Requirements:
Xcode 3.2 or later, Mac OS X v10.6 or later, iPhone OS 3.2 or later
Runtime Requirements:
Mac OS X v10.6 or later, iPhone OS 3.2 or later

This sample shows how to use a search field in a toolbar. When you start a search, a table view displaying recent searches matching the current search string is displayed in a popover.

The main view controller adds to a toolbar a bar button item with a search field as a custom view. If you tap the search field, the view controller presents a popover containing a list of recent searches. The list is stored in user defaults so that it persists between launches of the application, and is managed by the list's table view controller. The recents list is filtered by the current search term. If you select an item from the recents list, the item is copied to the search field and a search executed.




Last updated: 2010-04-19

Did this document help you? Yes It's good, but... Not helpful...