• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Redeclaring property types in mutable subclasses
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Redeclaring property types in mutable subclasses
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Release Build PPC Link Error
  • Next by Date: UI Panel With "Pointer" On One Side
  • Previous by thread: Re: Release Build PPC Link Error
  • Next by thread: Re: Redeclaring property types in mutable subclasses
  • Index(es):
    • Date
    • Thread