ios - UITableView delays for 20 to 50 seconds after cellForRowAtIndexPath is called -


i long delay showing table after cellforrowatindexpath , willdisplaycell functions called. make sure call reloaddata main thread. show 10 rows. delay 20 50 seconds. here of code:

calling reloaddata main thread:

dispatch_async(dispatch_get_main_queue(), ^{ [uiview animatewithduration:0 animations:^{     [self.tableview reloaddata]; } completion:^(bool finished) {     nslog(@"after reload data=%lu", (unsigned long)self.tableview.visiblecells.count);     //do after that... }]; 

here cellforrowatindexpath function:

-(uitableviewcell *) tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { ipequipmentcell *cell = [tableview dequeuereusablecellwithidentifier:ipequipmentcell.cell_id forindexpath:indexpath]; if (cell == nil) {     cell = [[ipequipmentcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:ipequipmentcell.cell_id]; } ipequipment *equip = self.equipmentresults[indexpath.row]; if ([@"y" isequaltostring:equip.checkedin]) {     cell.checkmarklabel.hidden = no; } else {     cell.checkmarklabel.hidden = yes; }  cell.descriptionlabel.text = equip.descrip; cell.equipidlabel.text = [nsstring stringwithformat:@"id: %@", equip._id]; cell.serialidlabel.text = [nsstring stringwithformat:@"serial/vin: %@", equip.serial]; cell.iptrackinglabel.text = [nsstring stringwithformat:@"ip tracking: %@", equip.iptracking]; cell.sellerassetlabel.text = [nsstring stringwithformat:@"seller asset: %@", equip.sellerasset];  nslog(@"cellforrowatindexpath=%@", equip); return cell; 

here willdisplaycell function:

-(void) tableview:(uitableview *)tableview willdisplaycell:(uitableviewcell *)cell forrowatindexpath:(nsindexpath *)indexpath {     cell.contentview.hidden = no;     nslog(@"willdisplaycell=%@", indexpath); } 

i have gone through debugger , stepped through code , seems execution finished , delay happens afterwards. please help?


Comments