“无法恢复先前选择的帧”在循环遍历NSDictionary时 [英] "Unable to restore previously selected frame" when looping through NSDictionary
本文介绍了“无法恢复先前选择的帧”在循环遍历NSDictionary时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的应用中出现以下错误:
I got the following errors in my app:
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_BAD_ACCESS
[propertyData release];
解析之前json字符串如下所示(因此您可以了解数据的结构,解析但工作正常):
the json string looks like the following before parsing (so you may understand how data are structured, the parsing works fine though):
{
"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>"}
]
}
对于什么是错误的任何想法?
Any idea of what's wrong ?
Thx的帮助,
Stephane
推荐答案
您没有分配/初始化PropertyData。指针指的是内存中的一些随机位置,然后你发送它释放消息,导致EXC_BAD_ACCESS,
You are not allocating/initializing PropertyData. The pointer is referring to some random place in memory, and then you are sending it "release" message which causes the EXC_BAD_ACCESS,
这篇关于“无法恢复先前选择的帧”在循环遍历NSDictionary时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文