Archive for November 23, 2014

Sunday, November 23, 2014

NSAtom, the True Object

Brian Webster:

In our case, if our method is returning a YES value, that will end up with a full value of 0x0000000000000001. If you try interpreting this value as an object, the runtime will think it is a tagged pointer, since the bottom bit is 1. OK then, so what kind of object is this exactly?

[…]

Ah, so it looks like, whether by design or by accident, no matter what message you send to NSAtom, it returns a value of 1.

Update (2015-01-17): There’s been further discussion of NSAtom on Twitter.