【发布时间】:2015-09-20 14:04:58
【问题描述】:
我正在从服务器获取数据,并且能够接收所有数据,但是当我运行项目时它显示空白单元格。当我保留断点时,我了解到代码在VisitorsTableViewCell *cell = (VisitorsTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 之后没有执行。
注意:此代码在 xcode 6.4 中完美运行
- (NSInteger)numberOfSectionsInTableView:(UITableView *)aTableView {
// Number of sections is the number of regions
return 1;
}
- (NSInteger)tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section {
// Number of rows is the number of time zones in the region for the specified section
return [VisitorsNameArray count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"VisitorsTableCell";
VisitorsTableViewCell *cell = (VisitorsTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell.visitorName.text = [VisitorsNameArray objectAtIndex:indexPath.row];
cell.visitorComment.text = [VisitorsCommentArray objectAtIndex:indexPath.row];
cell.visitorDate.text = [VisitorsDateArray objectAtIndex:indexPath.row];
cell.visitorLocation.text = [VisitorsLocationArray objectAtIndex:indexPath.row];
return cell;
}
【问题讨论】:
标签: ios objective-c uitableview ios9