Redeclaring property types in mutable subclasses
Redeclaring property types in mutable subclasses
- Subject: Redeclaring property types in mutable subclasses
- From: Adam Ernst <email@hidden>
- Date: Mon, 28 Mar 2011 23:05:47 -0400
I have a class with an array property:
@interface Widget : NSObject {}
@property (retain, readonly) NSArray *gizmos;
@end
I make a mutable subclass. In addition to making the array property readwrite, I also make it an NSMutableArray for convenience:
@interface MutableWidget : Widget {}
@property (retain, readwrite) NSMutableArray *gizmos;
@end
This triggers a warning:
Property 'gizmos' type does not match super class 'Widget' property type
I can understand why this is being triggered. How can I work around it? I could keep it a straight NSArray, but this is cumbersome to edit. Suggestions on how to properly model this in my code?
Adam
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden