我有一個奇怪的問題。XCode UITable滾動更改文本值
我加載在線數值並顯示在我的UITableViewCell
中。它工作正常...我面臨的問題是,如果我向下滾動應用程序提取從網上相應,但當我向上滾動,值正確匹配...
如果strLocation
不爲空我顯示如果strLocation
爲空,我隱藏LocationImageView
。當我最初加載應用程序時,這工作正常,當我滾動表格並向下移動時,如果某個值的空格爲strLocation
,它隱藏了LocationImageView
,但是在表格頂部的strLocation不爲空的情況下會發生什麼這些地方也LocationImageView
被隱藏。
我想知道如何與細胞打交道時解決這個問題
cell.cityLabel.text = [dictionary valueForKey:@"location"];
NSString *strLocation = [dictionary valueForKey:@"location"];
if ([strLocation isEqual:@""]){
cell.LocationImageView.hidden=TRUE;
}
發佈更多驗證碼。特別是你應該發佈你的整個'tableView:cellForRowAtIndexPath:'方法。 – Dima
它是一個大代碼,理解邏輯[cell setSelectionStyle:UITableViewCellSelectionStyleNone]會令人困惑;靜態NSString * simpleTableIdentifier = @「HomeTablecell」; cell =(HomeTableCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; cell.vEdit.hidden = TRUE;如果(cell == nil) NSArray * nib = [[NSBundle mainBundle] loadNibNamed:@「HomeTableCell」owner:self options:nil]; cell = [nib objectAtIndex:0]; } NSDictionary * dictionary = [self.allPostArray objectAtIndex:indexPath.row]; –
我已經給出部分代碼 –