UITableview didselect method is not caling after search something using search bar

若如初见. 提交于 2019-12-12 04:58:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!