1

i have added a search bar to my table view and it is working and returning results correctly. However, the results are showing up, using my custom cell, but the underlying table does not "stretch" to fit the cell. I hope that makes sense. Here is my code:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{


static NSString *CellIdentifier = @"Cell";


CustomBuyMainCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];

if (cell == nil) {

    cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];


}

Item *item = nil;

if (tableView == self.searchDisplayController.searchResultsTableView) {

    item = (Item *)[self.filteredItemArray objectAtIndex:indexPath.row];}

else {

    item = (Item *)[self.itemArray objectAtIndex:indexPath.row];}

I believe it has something to do with this code. But i'm not sure. It seems the searchResultsTableView does not know about the custom cell...and the custom cell just overlays on top of it and the underlying table doesn't accommodate it. Any help is greatly appreciated!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.