Thursday 15 September 2011

ios - Getting Assertion Failure in UISearchResultsTableView -



ios - Getting Assertion Failure in UISearchResultsTableView -

i'm getting next error when start type search text in searchbar

assertion failure in -[uisearchresultstableview _configurecellfordisplay:forindexpath:]

my cellforrowatindexpath code search display controller follows :

if(tableview == self.searchdisplaycontroller.searchresultstableview) { static nsstring *cellidentifier = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if(cell == nil) { cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; } cell.textlabel.text = [search objectatindex:indexpath.row]; homecoming cell; }

please help

replace code 1 may work.

if(tableview == self.searchdisplaycontroller.searchresultstableview) { static nsstring *cellidentifier = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if(cell == nil) { cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstylesubtitle reuseidentifier:cellidentifier]; } cell.textlabel.text = [search objectatindex:indexpath.row]; homecoming cell; }

because 1 time find cell object nil 1 time again allocating cell nil object using [tableview dequeuereusablecellwithidentifier:cellidentifier]; that's why not working.

ios uisearchbar uisearchdisplaycontroller

No comments:

Post a Comment