“无法恢复先前选择的帧”当循环遍历 NSDictionary 时

发布于 2024-12-04 03:35:44 字数 1037 浏览 4 评论 0原文

我在我的应用程序中遇到以下错误:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天涯离梦残月幽梦 2024-12-11 03:35:44

您没有分配/初始化 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,

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文