NSDictionary mutableCopy 引发 exc_bad_access
复制 NSDictionary 中的键后,我遇到了崩溃。我正在使用ARC。原因是什么?
-(NSArray*) findClosestPointsAroundPoint: (NSDictionary*) p inTable: (NSString*) table {
NSMutableArray* fields = [[p allKeys] mutableCopy];}
(gdb) po table
0xef7b880 does not appear to point to a valid object.
After copying the keys in NSDictionary, I get a crash. I am using ARC. What is the reason?
-(NSArray*) findClosestPointsAroundPoint: (NSDictionary*) p inTable: (NSString*) table {
NSMutableArray* fields = [[p allKeys] mutableCopy];}
(gdb) po table
0xef7b880 does not appear to point to a valid object.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据推测,
table
尚未设置,或者已设置为 nil 值。尝试 NSLog(@"TABLE ->%@"<- TABLE, table); 看看table
的值是什么。Presumably the
table
hasn't been set, or has been set to a nil value. TryNSLog(@"TABLE ->%@"<- TABLE, table);
to see what the value oftable
is.