Subclassing NSControl and inheritance of target, action properties
Subclassing NSControl and inheritance of target, action properties
- Subject: Subclassing NSControl and inheritance of target, action properties
- From: Graham Cox <email@hidden>
- Date: Fri, 30 Jan 2015 10:44:19 +1100
NSControl has properties target, action.
I want to subclass NSControl but my custom control doesn't use a cell internally. I want to inherit the target, action properties so that I can hook these up for my custom subclass in IB (If I don't inherit NSControl, IB is unaware that I have target, action properties that can be connected in the usual way). The standard control class actually implements the storage for these properties in its cell, so if I don't redeclare the properties, there's no storage and so the properties always return nil.
If I redeclare the storage, to use my own storage ivars via @synthesize, the properties have to be nonatomic, but the original properties don't define this, so the compiler complains that the redeclared properties do not match the originals.
What's the right way to do this, so that I can cleanly inherit the properties without complaint, but back them with whatever storage implementation I wish?
--Graham
_______________________________________________
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