2
我有我添加以編程方式的UISearchBar這樣的(這是我的viewDidLoad)一個表視圖控制器:的UISearchBar時以編程方式添加不`噸調用didSelectRowAtIndexPath方法
searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 64)];
searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self];
searchDisplayController.delegate = self;
searchDisplayController.searchResultsDataSource = self;
searchBar.delegate = self;
[self.tableView.tableHeaderView addSubview:searchBar];
[self.tableView.tableHeaderView sizeToFit];
我dont`t設置爲tableHeaderView因爲我對標題有另一種看法(藍色)。
問題是,當我搜索並點擊單元格,方法didSelectRowAtIndexPath方法沒有被調用。而且,正如它在我的圖片上顯示的那樣,我需要知道選中的單元格是否添加了複選標記。