“无法恢复先前选择的帧”当循环遍历 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:@"items"])
{
PropertyData *propertyData; // mere data model class with properties only,no methods
[propertyData release];
}
突出显示此行线程1:程序收到信号:“EXC_BAD_ACCESS”
[propertyData release];
json字符串在解析之前如下所示(因此您可能会理解数据是如何构造的,但解析工作正常):
{
"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>"}
]
}
知道出了什么问题吗?
感谢您的帮助,
斯蒂芬
I got the following errors in my app:
warning:Unable to restore previously selected frame
warning:Unable to restore previously selected frame
when using the following code:
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];
}
with this line hightlighted Thread 1: Program received signal: "EXC_BAD_ACCESS"
[propertyData release];
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 for helping,
Stephane
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您没有分配/初始化 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,