【发布时间】:2013-07-01 06:02:30
【问题描述】:
我正在尝试将一个对象添加到一个数组中,但它发送了 zig bart 错误 “无法识别的选择器发送到实例” 下面是我的代码
AppDelegate *appdelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
NSDictionary *infomation = [self dictionaryWithContentsOfJSONString:@"Contacts.json"];
IstructContactsOrgByEntity *ObjIstructContactsOrgByEntity=[[IstructContactsOrgByEntity alloc]initWithIstructContactsOrgByEntity:infomation];
NSArray *array=[infomation objectForKey:@"contacts_list"];
for (int ndx = 0; ndx < [array count]; ndx++)
{
NSDictionary *stream = (NSDictionary *)[array objectAtIndex:ndx];
IstructContacts_List *ObjIstructContacts_List=[[IstructContacts_List alloc]initWithIstructContacts_List:stream];
NSArray *Qnarray=[stream objectForKey:@"contacts"];
for (int i=0; i<Qnarray.count; i++)
{
NSDictionary *Qnstream = (NSDictionary *)[Qnarray objectAtIndex:i];
IstructContacts *ObjIstructContacts=[[IstructContacts alloc]initWithIstructContacts:Qnstream];
[ObjIstructContacts_List.m_muteArrContacts addObject:ObjIstructContacts];
}
[ObjIstructContactsOrgByEntity.m_muteArrContacts_List addObject:ObjIstructContacts_List];
}
[appdelegate.m_ArrContactsOrgEntity addObject:ObjIstructContactsOrgByEntity];
最后一行[appdelegate.m_ArrContactsOrgEntity addObject:ObjIstructContactsOrgByEntity];
导致我的问题。
【问题讨论】:
-
我想知道有多少关于 unrecognized selector 和 JSON 的问题?我敢打赌,我可以在 2 分钟内找到 5 个骗子。
-
什么是 zig bart 错误?您是说 SIGABRT 吗?
标签: iphone ios objective-c ipad nsmutablearray