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,或者有另一種方法來解決這個問題,我會非常感激和感謝任何建議,代碼,教程。請多關照