Friday, July 1, 2016

Objective-C Class Properties

Andrew Madsen:

Xcode 8 ships with a new versions of Clang and LLVM (800., and 8.0.0 as of the first beta). The new version of Clang adds support for class properties in Objective-C. The feature is not yet fully documented anywhere that I can find, so I did a little experimenting.


It is important to note that unlike regular instance properties, Objective-C class properties can not be synthesized using @synthesize, nor are they automatically synthesized by the compiler. You are responsible for implementing accessor methods for them yourself. (You can also use an @dynamic for them to tell the compiler that accessor methods will be provided at runtime.)

Comments RSS · Twitter

Leave a Comment