Next Page > Hide TOC

NSUserInterfaceValidations Protocol Reference

Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in Mac OS X v10.0 and later.
Companion guide
Declared in
NSUserInterfaceValidation.h

Overview

The NSUserInterfaceValidations protocol works with the NSValidatedUserInterfaceItem protocol to enable or disable a control automatically, depending on whether any responder in the responder chain can handle the control’s action method. The NSMenuItem and NSToolbarItem classes take advantage of these protocols.

By conforming to this protocol, your custom responder can participate in this validation mechanism. To validate a control, the application calls validateUserInterfaceItem: for each item in the responder chain, starting with the first responder. If no responder returns YES, the item is disabled. For example, a menu item that sends the copy: action message would disable itself if no responder in the responder chain can be copied.

Tasks

Validating User Interface Items

Instance Methods

validateUserInterfaceItem:

Returns whether the receiver can handle the action method for a user interface item.

- (BOOL)validateUserInterfaceItem:(id < NSValidatedUserInterfaceItem >)anItem

Parameters
anItem

The user interface item to validate. You can send anItem the action and tag messages.

Return Value

YES if the receiver can handle the action method; NO if it cannot.

Availability
Declared In
NSUserInterfaceValidation.h

Next Page > Hide TOC


© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-05-23)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.