Jonathan Sterling – Typed Collections with Self Types in Objective-C:
The latest versions of the Clang compiler extend the Objective-C language with related return types, which allow a limited form of covariance to be expressed. Methods with certain names (
alloc,init, etc.) are inferred to return an object of the instance type for the receiver; other methods can participate in this covariance by using theinstancetypekeyword for the return type annotation.
This is what I really want in the next version of Objective C.
Enjoy!