PATH |
NSKeyValueCoding.UnknownKeyException
- Inherits from:
- RuntimeException
- Package:
- com.webobjects.foundation
Class Description
Instances of the NSKeyValueCoding. UnknownKeyException class are created and thrown when an unknown key is encountered during key-value coding.
For example, suppose an Employee object receives a valueForKey message with "partNumber" as the key. The Employee class doesn't declare a method or instance variable for "partNumber", so valueForKey throws an UnknownKeyException. An NSKeyValueCoding. UnknownKeyException has a userInfo dictionary containing entries for the object for which key-value coding failed ( TargetObjectUserInfoKey) and the unknown key ( UnknownUserInfoKey). For the Employee/partNumber example, the TargetObjectUserInfoKey
entry would contain the Employee object and the UnknownUserInfoKey
would contain the string "partNumber".
For more information on key-value coding and error conditions, see the NSKeyValueCoding and NSKeyValueCoding.ErrorHandling interface specifications.
Constants
NSKeyValueCoding. UnknownKeyException defines the following constants:
Constant | Type | Description |
TargetObjectUserInfoKey | String |
The key for an entry in the exception's user info dictionary. The entry contains the target object that does not implement the unknown key. This constant is deprecated. You should access this user info dictionary entry using the object method. |
UnknownUserInfoKey | String |
The key for an entry in the exception's user info dictionary. The entry contains the unknown key. This constant is deprecated. You should access this user info dictionary entry using the key method. |
Constructors
NSKeyValueCoding.UnknownKeyException
public NSKeyValueCoding.UnknownKeyException( String message, Object anObject, String key)
public NSKeyValueCoding.UnknownKeyException( String message, NSDictionary userInfo)
Instance Methods
key
public String key()
object
public Object object()
userInfo
public NSDictionary userInfo()
© 2001 Apple Computer, Inc. (Last Published April 17, 2001)