1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
class A {}; class B : public A {}; class C {}; @interface IA @property (nonatomic, readonly) A* foo; @end @interface IB : IA @end @implementation IB - (B*)foo { return new B; } @end