> On Oct 1, 2015, at 11:28 PM, Gerriet M. Denkmann <gerr...@mdenkmann.de> wrote:
> 
> I inherited some code with:
> 
> @interface BaseThing : NSObject <NSCopying>
> 
> @property (nonatomic) SomeDataClass *stuff;
> 
> @end
> 
> 
> @interface SubThing : BaseThing
> 
> @property (nonatomic) SubDataClass* stuff;    //      SubDataClass is a 
> subclass of SomeDataClass
> 
> @end
> 
> 
> @implementation SubThing
> 
> // nothing about stuff here
> 
> @end
> 
> 
> Xcode 7.0 tells me:
> warning: auto property synthesis will not synthesize property ‘stuff’; it 
> will be implemented by its superclass, use @dynamic to acknowledge intention.
> 
> I don’t think that I want ’stuff’ to be implemented by its superclass. Rather 
> I want it to be overridden. So I am not sure, whether @dynamic is the right 
> thing to do.
> 
> How to make the compiler happy?

Two options:

1) Implement -stuff and -setStuff: in your @implementation. If you do this, you 
don’t even need to declare stuff in the @interface.

2) Keep the declaration in the @interface, and stick “@synthesize stuff;” in 
the @implementation.

Charles


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to