ios - Exception caused by custom cells: UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath: -


i got following exception:

fatal exception: nsinternalinconsistencyexception uitableview datasource must return cell tableview:cellforrowatindexpath:

my tableview has custom cells. code works. however, exception happened once.

-(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath {      // cell populate     uitableviewcell* cell = [tableview dequeuereusablecellwithidentifier:@"appt"];      if (!cell) {         // create new cell         cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:@"appt"];          // populate nib         uinib* nib = [uinib nibwithnibname:@"scheduledrowview" bundle:nil];         nsarray* views = [nib instantiatewithowner:nil options:nil];         uiview* parent = [views objectatindex:0];         cgrect rowrect = parent.frame;         rowrect.size.width = tableview.frame.size.width;         parent.frame = rowrect;         cell.frame = rowrect;         [cell addsubview:parent];     }      // populate cell     // code populating cell..      return cell; } 


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -