среда, 1 мая 2013 г.

ObjC messages to nil

It's wide known fact that in ObjC you can safely send any message to 'nil' object. Implementation turned out to be a bit more tricky than I supposed, here is code of 'libobjc': Message will go to another receiver if system finds some value in '__objc_nilReceiver'! Moreover I found private ad-hoc function to change value of this variable without a hassle. And here is code that prints "Some" Just interesting fact to know...

Комментариев нет: