On Dec 13, 2015, at 14:59 , Luc Van Bogaert <luc.van.boga...@me.com> wrote:
> 
> I have a NSButton subclass that I want to conform to 
> NSValidatedUserInterfaceItem, so I can call validateUserInterfaceItem: on a 
> validator passing the button as a parameter. This requires my subclass to 
> implement two methods: action() and tag(). The compiler complains about the 
> selectors being identical to the 'action' and 'tag' selectors in superclass 
> NSControl.

What do your subclass implementations look like (the signature, not the body)?

According to the documentation, NSControl already has the conforming 
properties, so you don’t need to define your own. Just assign the correct 
values to the existing properties.

However, the Swift version of NSValidatedUserInterfaceItem declares the 
properties as methods, so this may be confusing the issue. In Obj-C, it’s all 
the same thing — the getter for “action” is also the method “action”, but I’m 
not sure what happens during bridging. (It ought to realize they’re the same 
thing.)

What happens if you *don’t* declare action and tag in your subclass? Is there a 
non-conformance warning?
_______________________________________________

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