我需要用从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
你确定报错的代码是你贴出的位置吗?
通过错误的提示可以看出,你有可能是对一个NSDictionary 对象发送了isEqualToString消息. 而 NSDictionary没有对isEqualToString的定义.