【发布时间】:2016-05-20 14:06:16
【问题描述】:
我这里有这行代码:
punchList = [[[NSMutableDictionary alloc]initWithDictionary:[[[areaData GetPunchListDataArray:communityDesc] objectForKey:@"Root"] objectForKey:@"KeyValue"]] autorelease];
但是当我运行它时这给了我一个错误:
dictionary argument is not an NSDictionary
当我这样做时:
punchList = [[[NSMutableDictionary alloc]initWithDictionary:[[areaData GetPunchListDataArray:communityDesc] objectForKey:@"Root"]] autorelease];
punchList = [punchList objectForKey:@"KeyValue"];
我没有收到任何错误,punchList 被填充了,为什么它在我做的第一种方式下不起作用。
【问题讨论】:
-
你为什么还在使用
autorelease? ARC怎么了? -
您在学习旧教程吗?你不再需要自动释放了。
标签: ios objective-c