Jonathan F.
Jonathan F.

Reputation: 2364

UISearchBar with UITableView containing custom cells => blank cells

Why have I this behaviour ? Thanks a lot for your help... I precise that the filteredArray and the notFilteredArray are correctly filled (I checked that many times). It means that the search mechanism is working well.

Upvotes: 0

Views: 1604

Answers (3)

Marc Smith
Marc Smith

Reputation: 349

After much "searching" (pun) I've found the problem.

When you reference the tableview with the prototype cell you can't rely on the tableview that is passed in because sometimes that tableview is the search tableview without the prototype cell.

so instead of...

HomeTabCell *cell = (HomeTabCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];

replace the "tableview" above with a direct connection to the table view with the prototype cell

HomeTabCell *cell = (HomeTabCell *)[self.HomeTableView dequeueReusableCellWithIdentifier:CellIdentifier];

Hope this helps!

Upvotes: 7

Jonathan F.
Jonathan F.

Reputation: 2364

Sorry for people searching to resolve this issue... I could not fix it, and the prime contractor do not want this function anymore, so I gave up.

Upvotes: 0

Sandeep Ahuja
Sandeep Ahuja

Reputation: 931

Check these settings, if there not

self.searchDisplayController.searchResultsDelegate = self; self.searchDisplayController.searchResultsDataSource = self;

try this,

Upvotes: 0

Related Questions