我在那里我阅读dispatch_async内的UITableView的自定义单元格的子视图的内容(的情况下),如下:Dispatch_async停止的UITableView重装
dispatch_async(myQueue,^{
[self filterArrays];
[self updateSlotData];
});
的updateSlotData内:我想访问的UITableViewCell的子视图如下:
for (int i = 1 ; i <= [slotTable numberOfRowsInSection:0]; i++) {
SlotDataCell *cell = (SlotDataCell *)[slotTable cellForRowAtIndexPath:[NSIndexPath indexPathForItem:i-1 inSection:0]];
NSLog(@"iterating inside %i %i %i",[cell.intTF.text length],[cell.toTF.text length],[cell.fromTF.text length]);
if(![cell.intTF.text length] || ![cell.toTF.text length] || ![cell.fromTF.text length]){
outdatedTF = [NSString stringWithFormat:@"Slot %i timing",i];
newSlot = false;
return NO;
}
}
在调用重装数据: isDBSelected = FALSE; addMode = false; [slotTable reloadData];
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if(tableView == slotTable){
if(isDBSelected){
if(addMode){
return [countArray count] + 1;
}else{
return [countArray count];
}
}else{
NSLog(@"new template creation started");
return 1;
}
}
return 0;
}
该表重新加载,第一行被初始化为零。其他行似乎不会消失。预期结果:只创建一行。
任何UI更新都必须位于主线程上。 – Kreiri 2013-05-07 08:58:21
@Kreiri如果UI更新发生在后台线程意味着什么,会发生什么? – Mani 2013-05-07 09:04:38
该线程的EXC_BAD_ACCESS – DesperateLearner 2013-05-07 09:08:15