Iphone &引用;无法还原以前选择的帧";当循环通过NSDictionary时
我的应用程序中出现以下错误:Iphone &引用;无法还原以前选择的帧";当循环通过NSDictionary时,iphone,ios,ios4,nsarray,nsdictionary,Iphone,Ios,Ios4,Nsarray,Nsdictionary,我的应用程序中出现以下错误: warning:Unable to restore previously selected frame warning:Unable to restore previously selected frame 使用以下代码时: NSDictionary *feed = [json_parser objectWithString:json_str error:nil]; for(NSDictionary *feed_item in [feed objectForKey
warning:Unable to restore previously selected frame
warning:Unable to restore previously selected frame
使用以下代码时:
NSDictionary *feed = [json_parser objectWithString:json_str error:nil];
for(NSDictionary *feed_item in [feed objectForKey:@"items"])
{
PropertyData *propertyData; // mere data model class with properties only,no methods
[propertyData release];
}
该行高亮显示时线程1:程序收到信号:“EXC\U BAD\U访问”
解析之前,json字符串如下所示(因此您可以理解数据的结构,尽管解析工作正常):
{
“总计”:110,“第1页”,
“项目”:[
{“pid”:“1349”,“价格”:“52000”,“类型”:“公寓”,“床”:“descr1”:“”},
{“pid”:“1349”,“价格”:“52000”,“类型”:“公寓”,“床”:“descr1”:“”},
{“pid”:“1349”,“价格”:“52000”,“类型”:“公寓”,“床”:“descr1”:“”}
]
}
你知道怎么了吗
谢谢你的帮助
Stephane您没有分配/初始化PropertyData。指针指向内存中的某个随机位置,然后您向它发送“release”消息,这会导致EXC\u BAD\u访问,您没有分配/初始化PropertyData。指针指向内存中的某个随机位置,然后您向它发送“release”消息,这会导致EXC_BAD_访问失败,您可以在此处发布崩溃日志/堆栈跟踪吗?它只是“警告:无法恢复以前选择的帧”多次没有其他内容我发现问题所在:PropertyData*PropertyData;它应该是:PropertyData*PropertyData=[[PropertyData alloc]init];简言之,使用前的分配。。。谢谢!你能在这里发布崩溃日志/堆栈跟踪吗?它只是“警告:无法恢复以前选择的帧”很多次没有更多我发现了问题所在:PropertyData*PropertyData;它应该是:PropertyData*PropertyData=[[PropertyData alloc]init];简言之,使用前的分配。。。谢谢!
[propertyData release];
{
"total":110,"page":1,
"items":[
{"pid":"1349","price":"52,000","type":"Apartment","beds":"","descr1":"<p></p>"},
{"pid":"1349","price":"52,000","type":"Apartment","beds":"","descr1":"<p></p>"},
{"pid":"1349","price":"52,000","type":"Apartment","beds":"","descr1":"<p></p>"}
]
}