问题
I have a problem in UITableView
I added a searchbar to my tableview. Searchbar is working.And tables are also working properly. but when I search some thing using that searchbar I cannot click any of tables (didselect method is not calling). What is the reason for this. Can anyone help me to solve this?
.h class
@interface HomeViewController : UIViewController<UITabBarDelegate,UITableViewDataSource,UITableViewDelegate,FPPopoverControllerDelegate,AVAudioPlayerDelegate,UISearchBarDelegate>
`
.m Viewdidload
`
searchbarAllusers.delegate=(id)self;
searchbarAllusers.showsCancelButton = YES;
`
Searchmethods `
-(void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
if (searchBar.text.length==0) {
isSearch=NO;
}
else
{
isSearch=YES;
if (searchBar.tag==1) {
[self filterListForSearchText:searchBar.text :@"USR"];
}
else if (searchBar.tag==2)
{
[self filterListForSearchText:searchBar.text :@"ARTIST"];
}
[searchBar resignFirstResponder];
}
}
-(void)searchBarCancelButtonClicked:(UISearchBar *)searchBar2
{
[searchBar2 resignFirstResponder];
isSearch=NO;
if (searchBar2.tag==1) {
[tblAddFriends reloadData];
}
else if (searchBar2.tag==2)
{
arrArtistList=artistTemparray;
[tblArtists reloadData];
}
}
`
at the begining the app is starting, all tables are working properly including click events. But once I search some thing,tables become lock (not calling didselect method)
Please help me
thanks
来源:https://stackoverflow.com/questions/17275481/uitableview-didselect-method-is-not-caling-after-search-something-using-search-b