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 逻辑谓词和消解原理的运用
  • ¥15 请求分析基于spring boot+vue的前后端分离的项目
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥200 关于#c++#的问题,请各位专家解答!网站的邀请码
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?