0
我有问题,在显示当前位置时显示当前位置和当不显示当前视图时,在表视图中设置noOfRowsInSection,似乎当我设置当前位置的当前位置“行自动插入到表格视图中,并调整noOfRowsInSection中的行数(即时统计地图中没有任何行的注释的数量),我通过在用户连接时简单地增加no来解决问题到互联网,我的代码:重新加载noOfRowsInSection当表视图重新加载,xcode
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
int countval=[[map annotations] count];
Reachability *reach=[[Reachability reachabilityForInternetConnection] retain];
NetworkStatus status = [reach currentReachabilityStatus];
if (searching)
{
return [copyListOfItems count];
}
else {
if([[self stringFromStatus:status] isEqualToString:@"Connected via wifi"] || [[self stringFromStatus:status] isEqualToString:@"Connected via WWAN"])
{
return countval+1;//
}
else
{
return countval;
}
}
}
但是,现在即时通讯有问题,同时使用重载
表10[self.tableView reloadData];
numberOfRowsInSection得到刷新和再次混淆,我怎么能在刷新时再次设置numberOfRowsInSection,或者有另一种方法来解决这个问题,我会非常感激和感谢任何建议,代码,教程。请多关照