developerWab 2013-02-21 06:22 采纳率: 0%
浏览 3611

用NSMutableArray中的数据充填UItableView

我需要用从NSMutableArray中的数据充填UITableView,但是出现了一个异常:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM isEqualToString:]: unrecognized selector sent to instance 0xa2ba880'

我的cellForRowAtIndexPath如下:

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

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }

    cell.textLabel.text = [callDetailArray objectAtIndex:indexPath.row];

    [cell setAccessoryType: UITableViewCellAccessoryDisclosureIndicator];

    return cell;
}

数组:

Array: (
        {
        callId = 3;
        callKeyword = CALL100;
        callName = "Call to All";
        callNumber = 5908;
    }
)

我希望UITableView中的单元可以显示来自callID的数据:callKeyword,callName和callNumber

  • 写回答

1条回答

  • ReyZhang 移动开发领域新星创作者 2013-02-21 06:27
    关注

    你确定报错的代码是你贴出的位置吗?
    通过错误的提示可以看出,你有可能是对一个NSDictionary 对象发送了isEqualToString消息. 而 NSDictionary没有对isEqualToString的定义.

    评论

报告相同问题?

悬赏问题

  • ¥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