searchBar = [[UISearchBar alloc] initWithFrame: CGRectMake(0.0, 0.0, self.view.bounds.size.width, 40)];
searchBar.placeholder=@"Enter Name";
searchBar.delegate = self;
searchBar.showsCancelButton = YES;
theTableView.tableHeaderView = searchBar;
searchBar.keyboardType = UIKeyboardTypeDefault;
//searchBar.autocorrectionType = UITextAutocorrectionTypeNo;
//searchBar.autocapitalizationType = UITextAutocapitalizationTypeNone;
[self.view addSubview: searchBar];
//search Button clicked....
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar // called when keyboard search button pressed
{
NSLog( @"%s,%d" , __FUNCTION__ , __LINE__ );
[searchBar resignFirstResponder];
}
//cancel button clicked...
- (void)searchBarCancelButtonClicked:(UISearchBar *) searchBar // called when cancel button pressed
{
NSLog( @"%s,%d" , __FUNCTION__ , __LINE__ );
[searchBar resignFirstResponder];
}