alllllllll 2013-02-21 08:10 采纳率: 0%
浏览 1689

从数字中得到指定值并在表视图显示

有一个数组,然后所有值都保存在arraypartno中,我将那个指定的值放在标签中,还要在单元中像PARTNUMBER一样显示:

代码:

for (int i =0 ; i<[arrData count]; i++)

   {    
        [arraypartno addObject:[[arrData objectAtIndex:i] valueForKey:@"Condition"]];
        [arraypartno addObject:[[arrData objectAtIndex:i] valueForKey:@"DateCode"]];
        [arraypartno addObject:[[arrData objectAtIndex:i] valueForKey:@"MFG"]];
        [arraypartno addObject:[[arrData objectAtIndex:i] valueForKey:@"PARTNUMBER"]];
        [arraypartno addObject:[[arrData objectAtIndex:i] valueForKey:@"Qty"]];
        [arraypartno addObject:[[arrData objectAtIndex:i] valueForKey:@"id"]];
    }

在 lblplate1.text中写的指定关键词,现在它显示了全部数组值。

UILabel *lblplate1 = [[UILabel alloc]initWithFrame:CGRectMake(20, 0, 200, 30)];

lblplate1.text = [arraypartno  objectAtIndex:indexPath.row];
lblplate1.textColor = [UIColor colorWithRed:2.0/255.0 green:143.0/255.0 blue:213.0/255.0 alpha:1];

lblplate1.backgroundColor =[UIColor clearColor];
[cell.contentView addSubview:lblplate1];
  • 写回答

1条回答 默认 最新

  • 睡觉不盖被 2015-08-25 03:52
    关注

    不明白楼主的如何存储,这样循环一遍后,arrayPartno 这个字典中 只存储了 一份数据 不是么 每次循环都是覆盖存储

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog