MapMapM 2013-01-25 02:47 采纳率: 0%
浏览 1863

如何在UIlabel显示核心数据

我在UITableView中正确的获取了核心数据,但是在UILabel失败了。

(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{
  static NSString *CellId = @"Cell";

  Cell *cell=[table dequeueReusableCellWithIdentifier:CellId];
  if (cell==nil) {
      [[NSBundle mainBundle]loadNibNamed:@"Cell" owner:self options:nil];
      cell=self.custom;
  }
  // Get the event corresponding to the current index path and configure the table view cell.
  Student *stu = (Student *)[dataarr objectAtIndex:indexPath.row];
  cell.item.text = [stu name];
  cell.rate.text = [stu rate];
  currentindex=indexPath.row;
  return cell;
}
  • 写回答

1条回答

  • 睡觉不盖被 2015-08-24 15:39
    关注

    没听懂楼主的意思 你得代码中没有出现UILable,在cell == nil 分支中 楼主 初始化cell 值的部分 是不是存在错误

    评论

报告相同问题?

悬赏问题

  • ¥15 高价求中通快递查询接口
  • ¥15 解决一个加好友限制问题 或者有好的方案
  • ¥15 关于#java#的问题,请各位专家解答!
  • ¥15 急matlab编程仿真二阶震荡系统
  • ¥20 TEC-9的数据通路实验
  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?