UISearchbar desaparece cuando la primera letra presiona el campo UISearchBar, iOS7

aquí mi código en view controller.h

#import "AppDelegate.h" @interface SearchRsultsFanSideViewController : UIViewController<UISearchBarDelegate,UISearchDisplayDelegate> { } @property (strong, nonatomic) IBOutlet UISearchBar *searchData; @property (strong, nonatomic) UISearchDisplayController *controller; 

en viewcontroller.m

 - (void)viewDidLoad { [super viewDidLoad]; searchResults=[[NSArray alloc]init]; self.controller = [[UISearchDisplayController alloc]initWithSearchBar:searchData contentsController:self]; self.controller.searchResultsDataSource = self; self.controller.searchResultsDelegate = self; } 

delegate method for UIsearchbar

 #pragma Mark - SearchBar Delegate - (void)filterData { searchResults = nil; NSPnetworkingicate *pnetworkingicate = [NSPnetworkingicate pnetworkingicateWithFormat:@"SELF contains [cd] %@", searchData.text]; NSArray *arrayaaa=[finalArray copy]; NSLog(@"The result Datas==%@",arrayaaa); searchResults = [[arrayaaa filtenetworkingArrayUsingPnetworkingicate:pnetworkingicate] mutableCopy]; } - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { [self.searchDisplayController setActive:YES]; [self filterData]; } 

testing esto

 - (void)searchDisplayControllerDidBeginSearch:(UISearchDisplayController *)controller{ [controller.searchBar setFrame:CGRectMake(44, 0, 320 - 44, 43)]; [self.searchDisplayController.searchResultsTableView setDelegate:self]; } 

Prueba esto:

 -(void) viewDidLayoutSubviews { [super viewDidLayoutSubviews]; if (self.searchDisplayController.isActive) { [self.navigationController setNavigationBarHidden:YES animated:YES]; } }