UISearchBarのscopeBar(検索バーの選択ボタン)を使うとき。

   UISearchBar *_searchBar = [[UISearchBar alloc]init];  
_searchBar.frame = CGRectMake(0, 0, self.tableView.bounds.size.width,0);
_searchBar.delegate = self;
_searchBar.tintColor = [UIColor darkGrayColor];
_searchBar.translucent = YES;
_searchBar.placeholder = @"Search Twitter";
NSArray *scopeButtonTitles = [[NSArray alloc] initWithObjects:@"All Tweets",@"User", nil];
_searchBar.scopeButtonTitles = scopeButtonTitles;
_searchBar.showsScopeBar = YES;
[_searchBar sizeToFit];
self.tableView.tableHeaderView = _searchBar;

showsScopeBarをYesにした後、
[_searchBar sizeToFit]; すると、
スコープバーが現れるんですね...

refer the link below:
UISearchBar Tricks – Showing The Cancel And The Scope Bar Only When Editing
http://www.alexandre-gomes.com/?p=418