Accessor implementation of properties

删除回忆录丶 提交于 2019-12-06 02:03:06

Is there some of documentation how the compiler auto-generates the accessors of properties?

The compiler just adds a C function call. Peek at the asm (e.g. _objc_getProperty and _objc_setProperty).

When writing custom accessors (overriding the synthesized ones), it would be nice to know the original implementation. Especially to see the differing implementations of accessors for properties with different (weak/strong/retain/copy etc..) attributes.

The implementations are publicly available as part of the objc runtime hosted at http://www.opensource.apple.com/source/objc4/.

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