简体   繁体   English

如何确定哪个NSArray导致了XCode中的异常

[英]How can I determine which NSArray has caused the Exception in XCode

I have a small project with about 5 or 6 arrays. 我有一个约5或6个数组的小项目。 Im getting a problem saying that my NSArray collection was mutated while being enumerated. 我收到一个问题,说我的NSArray集合在枚举时发生了突变。 But it doesn't tell me which Array its referring to. 但是它没有告诉我它指的是哪个数组。

How can I visualize which one it is in order to fix it? 如何可视化它以便修复它?

You can always use your friend NSLog, as you are looping through your arrays: 在遍历数组时,您始终可以使用朋友NSLog:

NSLog(@"your_array_name contains: %@", your_array_name");

It never hurts to print out the contents of each of your arrays to make sure you know what's being stored in them. 打印每个数组的内容以确保您知道存储在数组中的内容不会有任何伤害。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM