NSDictionary mutableCopy 引发 exc_bad_access

发布于 2024-12-19 13:53:10 字数 289 浏览 4 评论 0原文

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

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

发布评论

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

评论(1

筱果果 2024-12-26 13:53:10

据推测,table 尚未设置,或者已设置为 nil 值。尝试 NSLog(@"TABLE ->%@"<- TABLE, table); 看看 table 的值是什么。

Presumably the table hasn't been set, or has been set to a nil value. Try NSLog(@"TABLE ->%@"<- TABLE, table); to see what the value of table is.

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