iphone - [NSNull getCharacters:]:

三世轮回 提交于 2020-01-07 03:10:53

问题


I got the above in an error message.

[NSNull getCharacters:]:

I cannot find it in the documentation. Can someone explain to me what it means?

Many thanks.

Edit: This is a different one than the question than the one linked to which is about the use of NSNull getCharacters. This one just asks what it means.


回答1:


Straight from Apple documentation: "The NSNull class defines a singleton object used to represent null values in collection objects (which don’t allow nil values)."

From here on, it's pure speculation, as you've shown no code and no error message. If you push an object into a collection without checking it is not null, you'll be pushing NSNull. Then, if you have some kind of error or debugging, NSNull will call a private API getCharacters (which I'm guessing is private as there's no documentation). I suspect it is the equivalent of Java's toString() and is called when an error message is outputted.



来源:https://stackoverflow.com/questions/34663988/iphone-nsnull-getcharacters

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!