Наследование

Структуры (записи)

//В Objective-C структуры не поддерживают наследование
@protocol PText
- (NSString *) toText;
@end

@interface CPoint : NSObject<PText>
@property int x, y;
@end

@implementation CPoint
- (NSString *) toText {
    return [NSString stringWithFormat:@"x = %i; y = %i", self.x, self.y];
}
@end