我正在构建一个项目并想将 NSNumber 添加到 NSDictionary 中。但是它因为空值而崩溃。所以,我创建了另一个小程序来检查发生了什么。正如您在快照中看到的:为什么 NSDictionary 中的 NSNumber 的值为 null?
问问题
362 次
1 回答
2
I've run your code and I could reproduce the problem. But it seems like a debugger problem. For instance, if after your dictionary is created, go to the console and try printing the dictionary.
po dictionary
My result is like:
$4 = 0x2083e770 {
number = 1;
}
So it's not null at all. Also, after that, anum is assigned correctly and b is set to YES. So it really looks like a debugger issue instead of a bug from you.
于 2013-08-20T05:00:06.057 回答