objective c - Incompatible pointer types returning 'UITableViewCell *__strong' from a function with result type 'UITableView *' -


i loading search results in tableview in following manner getting warning complains incompatible pointer types.

what mistake in code below?

// our tableview containing search results. - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section {     if (searchresults == nil) {         return 0;     } else {         return [searchresults count];     } } - (uitableview *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath {     static nsstring *cellidentifier = @"searchresultcell";      uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier];     if (cell == nil) {         cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier];     }      cell.textlabel.text = [searchresults objectatindex:indexpath.row];     return cell; } // end tableview  - (void)searchbarsearchbuttonclicked:(uisearchbar *)searchbar {     nslog(@"the search text is: '%@'", searchbar.text);     searchresults = [nsmutablearray arraywithcapacity:10];     (int = 0; < 3; i++) {         [searchresults addobject:[nsstring stringwithformat:@"fake result %d '%@'", i, searchbar.text]];     }     [self.tableview reloaddata]; } 

the return type of tableview:cellforrowatindexpath: incorrect. should uitableviewcell * instead of uitableview *.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -