Re: User interface validation doesn't work, right?
Re: User interface validation doesn't work, right?
- Subject: Re: User interface validation doesn't work, right?
- From: Keary Suska <email@hidden>
- Date: Thu, 2 Jul 2009 10:24:52 -0600
On Jul 2, 2009, at 1:48 AM, Bill Cheeseman wrote:
I'm not "assuming" that it works with all user controls. The
document I quoted from says it does, explicitly and in detail,
without qualification. All I asked in my original post is whether
I'm correct in concluding that in fact buttons don't work that way.
I understand that you've all confirmed that I'm correct in my
conclusion. Thanks.
You have to confess that the docs don't say, "all user interface items
conform to the NSValidatedUserInterfaceItem protocol and therefore
support validation." That is the only true *detailed* and *explicit*
statement that would indicate such. Anything else is an inference,
although a reasonable and understandable inference, considering the
docs in isolation.
Your argument seems to make the case that the problem is precisely how
the docs are *not* explicit, and therefore allow or encourage an
incorrect inference. I agree, conditionally.
It doesn't help to refer me to the NSUserInterfaceValidations and
NSValidatedUserInterface protocol documents, because that's where I
started. They are ambiguous, and they're very short on explanation.
In fact, I turned to the User Interface Validation document
precisely because I was seeking clarification of the protocol
documents. Telling me to go back and look at the protocol documents
doesn't help.
Well, looking at the methods that both protocols does shed light on
their purpose, as was explained by Andy Lee.
In trying to pin down whether buttons also do so, I looked at the
NSButton Class Reference document and found that it expressly
conforms to the NSUserInterfaceValidations protocol. I don't
understand why you say it doesn't.
I defer to Andy's explanation.
I did find it confusing when I read the NSMenuItem and NSToolbarItem
Class Reference documents, which say that they conform to the other
protocol, the NSValidatedUserInterface protocol. But this tends to
suggest that NSButton will work, too, since NSControl, from which
NSButton inherits, also conforms to the NSValidatedUserInterface
protocol. It doesn't say so, but Apple's documentation has a long
history of neglecting to mention all the protocols that a class
conforms to. I was able to confirm from the NSControl Class
Reference document, and you can too, that NSControl does implement
the -action and -tag methods required by the
NSValidatedUserInterface protocol. So, again, I don't understand why
you say it doesn't.
It's not a matter of docs, although it would be preferable that the
docs *do* indicate every protocol. Because the two protocols in
question are formal protocols, the @interface declaration must specify
conformance. If it doesn't, then no assumption of conformance should
be made. Pure and simple. Also, protocol conformance is not
inheritable in Objective-C. Therefore, neither NSControl, nor
NSButton, conform to the NSValidatedUserInterface protocol.
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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