0

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.

user1904273
  • 4,562
  • 11
  • 45
  • 96
  • Can you provide the full error message? – Brian Jan 07 '16 at 19:55
  • 1
    Possible duplicate of [iphone: \[NSNull getCharacters:\]: unrecognized selector error using NSPredicate](http://stackoverflow.com/questions/34663557/iphone-nsnull-getcharacters-unrecognized-selector-error-using-nspredicate) – luk2302 Jan 07 '16 at 20:06
  • Dont double post. And even if you had to, improve your question, this one is infinitely worse than the first one. – luk2302 Jan 07 '16 at 20:06
  • It is not a duplicate at all. This is a basic question about what NSNull get characters means. Sounds like you don't know. Otherwise you would have linked to an answer. – user1904273 Jan 07 '16 at 20:16
  • If you actually know what it means, which I doubt, I dare you to say what the answer is. Here's betting you have no clue! – user1904273 Jan 07 '16 at 20:17
  • I can tell you exactly what that is: text, without any context. Fix your code! You cannot find any documentation because **there is none** because it is **an error**! – luk2302 Jan 07 '16 at 20:20
  • No where in my code does [NSNull getCharacters:] appear. it is returned by the error message. That is why I am trying to understand what it means. A google search suggests it has something to do with ranges i.e. http://stackoverflow.com/questions/6881517/why-doesnt-nsstring-getcharacters-work-in-xcode, but it does not appear in my code. – user1904273 Jan 07 '16 at 20:29

1 Answers1

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.

Roy Falk
  • 1,685
  • 3
  • 19
  • 45