Retired Document
Important: This document may not represent best practices for current development. Links to downloads and other resources may no longer be valid.
Advanced UISearchBar
Last Revision: | Version 1.1, 2013-07-24 "AdvancedTableSearch" demonstrates how to search contents of a table view using UISearchDisplayController. |
Build Requirements: | iOS 6.0 SDK or later |
Runtime Requirements: | iOS 6.0 or later, Automatic Reference Counting (ARC) |
"AdvancedTableSearch" demonstrates how to use the UISearchDisplayController object in conjunction with a UISearchBar, effectively filtering in and out the contents of that table. If an iOS application has large amounts of table data, this sample shows how to filter it down to a manageable amount so that users to scroll through less content in a table. This sample is continuation of the "TableSearch" sample, yet provides a more advanced search algorithm on a more complex data source. Instead of simple string comparisons to filter out search results, this advanced version uses "filteredArrayUsingPredicate" on the NSArray of objects. To perform a search across multiple fields of an NSObject subclass, this sample makes use of compound predicates (NSCompoundPredicate) and NSExpressions to create a more advanced search algorithm.
Copyright © 2013 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2013-07-24