Please note, this blog entry is from a previous course. You might want to check out the current one.
Make one or more of your table views searchable. Check out UISearchDisplayController and UISearchBar.
Add a bar button to enable the search functionality in code and initialize it lazily:
@property (nonatomic, strong) IBOutlet UIBarButtonItem *searchButton;
...
- (UIBarButtonItem *)searchButton
{
if (!_searchButton) {
_searchButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSearch
target:self
action:@selector(searchButtonPressed:)];
}
return _searchButton;
}
- (void)viewDidLoad
{
...
self.navigationItem.rightBarButtonItem = self.searchButton;
}
Continue reading “cs193p – Assignment #6 Extra Task #4”