![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/share/doc/gnustep-base-doc/Base/Reference/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>NSKeyValueCoding informal protocol reference</title> </head> <body> <font face="serif"> <a href="Base.html">Up</a> <br /> <h1><a name="title$NSKeyValueCoding">NSKeyValueCoding informal protocol reference</a></h1> <h3>Authors</h3> <dl> <dt>Richard Frith-Macdonald (<a href="mailto:rfm@gnu.org"><code>rfm@gnu.org</code></a>)</dt> <dd> </dd> </dl> <p><b>Copyright:</b> (C) 2000,2002 Free Software Foundation, Inc.</p> <div> </div> <h1><a name="001000000000"> Software documentation for the NSObject(NSKeyValueCoding) informal protocol </a></h1> <h2><a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a>(<a name="category$NSObject(NSKeyValueCoding)">NSKeyValueCoding</a>)</h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSKeyValueCoding.h</dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> </p> <p> This describes an informal protocol for <em>key-value coding</em>, a mechanism whereby the fields of an object may be accessed and set using generic methods in conjunction with string keys rather than field-specific methods. Key-based access loses compile-time validity checking, but can be convenient in certain kinds of situations. </p> <p> </p> <p> The basic methods are implemented as a category of the <a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a> class, but other classes override those default implementations to perform more specific operations. </p> <p> </div> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)+accessInstanceVariablesDirectly">+accessInstanceVariablesDirectly</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)+useStoredAccessor">+useStoredAccessor</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-dictionaryWithValuesForKeys$">-dictionaryWithValuesForKeys:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-handleQueryWithUnboundKey$">-handleQueryWithUnboundKey:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-handleTakeValue$forUnboundKey$">-handleTakeValue:forUnboundKey:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-mutableArrayValueForKey$">-mutableArrayValueForKey:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-mutableArrayValueForKeyPath$">-mutableArrayValueForKeyPath:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-mutableSetValueForKey$">-mutableSetValueForKey:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-mutableSetValueForKeyPath$">-mutableSetValueForKeyPath:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-setNilValueForKey$">-setNilValueForKey:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-setValue$forKey$">-setValue:forKey:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-setValue$forKeyPath$">-setValue:forKeyPath:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-setValue$forUndefinedKey$">-setValue:forUndefinedKey:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-setValuesForKeysWithDictionary$">-setValuesForKeysWithDictionary:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-storedValueForKey$">-storedValueForKey:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-takeStoredValue$forKey$">-takeStoredValue:forKey:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-takeStoredValuesFromDictionary$">-takeStoredValuesFromDictionary:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-takeValue$forKey$">-takeValue:forKey:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-takeValue$forKeyPath$">-takeValue:forKeyPath:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-takeValuesFromDictionary$">-takeValuesFromDictionary:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-unableToSetNilForKey$">-unableToSetNilForKey:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-validateValue$forKey$error$">-validateValue:forKey:error:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-validateValue$forKeyPath$error$">-validateValue:forKeyPath:error:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-valueForKey$">-valueForKey:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-valueForKeyPath$">-valueForKeyPath:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-valueForUndefinedKey$">-valueForUndefinedKey:</a></li> <li><a rel="gsdoc" href="NSKeyValueCoding.html#method$NSObject(NSKeyValueCoding)-valuesForKeys$">-valuesForKeys:</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)+accessInstanceVariablesDirectly">accessInstanceVariablesDirectly </a></h3> + (BOOL) <b>accessInstanceVariablesDirectly</b>;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Controls whether the NSKeyValueCoding methods may attempt to access instance variables directly. NSObject's implementation returns <code>YES</code>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)+useStoredAccessor">useStoredAccessor </a></h3> + (BOOL) <b>useStoredAccessor</b>;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Controls whether <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-storedValueForKey$"> -storedValueForKey: </a> and <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-takeStoredValue$forKey$"> -takeStoredValue:forKey: </a> may use the stored accessor mechanism. If not the calls get redirected to <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-valueForKey$"> -valueForKey: </a> and <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-takeValue$forKey$"> -takeValue:forKey: </a> effectively changing the search order of private/public accessor methods and instance variables. NSObject's implementation returns <code>YES</code>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-dictionaryWithValuesForKeys$">dictionaryWithValuesForKeys: </a></h3> - (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*) <b>dictionaryWithValuesForKeys:</b> (<a rel="gsdoc" href="NSArray.html#class$NSArray">NSArray</a>*)keys;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns a dictionary built from values obtained for the specified <var>keys</var>. <br /> By default this is derived by calling <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-valueForKey$"> -valueForKey: </a> for each key. Any <code>nil</code> values obtained are represented by an <a rel="gsdoc" href="NSNull.html#class$NSNull">NSNull</a> instance. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-handleQueryWithUnboundKey$">handleQueryWithUnboundKey: </a></h3> - (id) <b>handleQueryWithUnboundKey:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Deprecated... use <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-valueForUndefinedKey$"> -valueForUndefinedKey: </a> instead. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-handleTakeValue$forUnboundKey$">handleTakeValue: forUnboundKey: </a></h3> - (void) <b>handleTakeValue:</b> (id)anObject<b> forUnboundKey:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Deprecated, use <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-setValue$forUndefinedKey$"> -setValue:forUndefinedKey: </a> instead. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-mutableArrayValueForKey$">mutableArrayValueForKey: </a></h3> - (<a rel="gsdoc" href="NSArray.html#class$NSMutableArray">NSMutableArray</a>*) <b>mutableArrayValueForKey:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns a mutable array value for a given key. This method: <ul> <li> Searches the receiver for methods matching the patterns insertObject:in<Key>AtIndex: and removeObjectFrom<Key>AtIndex:. If both methods are found, each message sent to the proxy array will result in the invocation of one or more of these methods. If replaceObjectIn<Key>AtIndex:withObject: is also found in the receiver it will be used when appropriate for better performance. </li> <li> If the set of methods is not found, searches the receiver for a the method set<Key>:. Each message sent to the proxy array will result in the invocation of set<Key>: </li> <li> If the previous do not match, and accessInstanceVariablesDirectly returns <code>YES</code>, searches for an instance variable matching _<key> or <key> (in that order). If the instance variable is found, messages sent to the proxy object will be forwarded to the instance variable. </li> <li> If none of the previous are found, raises an NSUndefinedKeyException </li> </ul> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-mutableArrayValueForKeyPath$">mutableArrayValueForKeyPath: </a></h3> - (<a rel="gsdoc" href="NSArray.html#class$NSMutableArray">NSMutableArray</a>*) <b>mutableArrayValueForKeyPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns a mutable array value for the given key path. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-mutableSetValueForKey$">mutableSetValueForKey: </a></h3> - (<a rel="gsdoc" href="NSSet.html#class$NSMutableSet">NSMutableSet</a>*) <b>mutableSetValueForKey:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns a mutable set value for a given key. This method: <ul> <li> Searches the receiver for methods matching the patterns add<Key>Object:, remove<Key>Object:, add<Key>:, and remove<Key>:, which correspond to the NSMutableSet methods addObject:, removeObject:, unionSet:, and minusSet:, respectively. If at least one addition and one removal method are found, each message sent to the proxy set will result in the invocation of one or more of these methods. If intersect<Key>: or set<Key>: is also found in the receiver, the method(s) will be used when appropriate for better performance. </li> <li> If the set of methods is not found, searches the receiver for a the method set<Key>:. Each message sent to the proxy set will result in the invocation of set<Key>: </li> <li> If the previous do not match, and accessInstanceVariablesDirectly returns <code>YES</code>, searches for an instance variable matching _<key> or <key> (in that order). If the instance variable is found, messages sent to the proxy object will be forwarded to the instance variable. </li> <li> If none of the previous are found, raises an NSUndefinedKeyException </li> </ul> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-mutableSetValueForKeyPath$">mutableSetValueForKeyPath: </a></h3> - (<a rel="gsdoc" href="NSSet.html#class$NSMutableSet">NSMutableSet</a>*) <b>mutableSetValueForKeyPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns a mutable set value for the given key path. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-setNilValueForKey$">setNilValueForKey: </a></h3> - (void) <b>setNilValueForKey:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> This method is invoked by the NSKeyValueCoding mechanism when an attempt is made to set an null value for a scalar attribute. This implementation raises an NSInvalidArgument exception. Subclasses my override this method to do custom handling. (E.g. setting the value to the equivalent of 0.) </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-setValue$forKey$">setValue: forKey: </a></h3> - (void) <b>setValue:</b> (id)anObject<b> forKey:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Sets the value if the attribute associated with the key in the receiver. The object is converted to a scalar attribute where applicable (and <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-setNilValueForKey$"> -setNilValueForKey: </a> is called if a <code>nil</code> value is supplied). Tries to use a standard accessor of the form setKey: where 'Key' is the supplied argument with the first letter converted to uppercase. <br /> If the receiver's class allows <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)+accessInstanceVariablesDirectly"> +accessInstanceVariablesDirectly </a> it continues with instance variables: <ul> <li> _key </li> <li> _isKey </li> <li> key </li> <li> isKey </li> </ul> Invokes <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-setValue$forUndefinedKey$"> -setValue:forUndefinedKey: </a> if no accessor mechanism can be found and raises NSInvalidArgumentException if the accessor method doesn't take exactly one argument or the type is unsupported (e.g. structs). If the receiver expects a scalar value and the value supplied is the NSNull instance or <code>nil</code>, this method invokes <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-setNilValueForKey$"> -setNilValueForKey: </a> . </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-setValue$forKeyPath$">setValue: forKeyPath: </a></h3> - (void) <b>setValue:</b> (id)anObject<b> forKeyPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Retrieves the object returned by invoking <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-valueForKey$"> -valueForKey: </a> on the receiver with the first key component supplied by the key path. Then invokes <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-setValue$forKeyPath$"> -setValue:forKeyPath: </a> recursively on the returned object with rest of the key path. The key components are delimited by '.'. If the key path doesn't contain any '.', this method simply invokes <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-setValue$forKey$"> -setValue:forKey: </a> . </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-setValue$forUndefinedKey$">setValue: forUndefinedKey: </a></h3> - (void) <b>setValue:</b> (id)anObject<b> forUndefinedKey:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Invoked when <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-setValue$forKey$"> -setValue:forKey: </a> / <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-takeStoredValue$forKey$"> -takeStoredValue:forKey: </a> are called with a key which can't be associated with an accessor method or instance variable. Subclasses may override this method to add custom handling. NSObject raises an NSUndefinedKeyException, with a userInfo dictionary containing NSTargetObjectUserInfoKey with the receiver an NSUnknownUserInfoKey with the supplied key entries. <br /> Called when the key passed to <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-setValue$forKey$"> -setValue:forKey: </a> cannot be used. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-setValuesForKeysWithDictionary$">setValuesForKeysWithDictionary: </a></h3> - (void) <b>setValuesForKeysWithDictionary:</b> (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*)aDictionary;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Uses <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-setValue$forKey$"> -setValue:forKey: </a> to place the values from <var>aDictionary</var> in the receiver. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-storedValueForKey$">storedValueForKey: </a></h3> - (id) <b>storedValueForKey:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns the value associated with the supplied key as an object. Scalar attributes are converted to corresponding objects. Uses private accessors in favor of the public ones, if the receiver's class allows <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)+useStoredAccessor"> +useStoredAccessor </a> . Otherwise this method invokes <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-valueForKey$"> -valueForKey: </a> . The search order is: <br /> Private accessor methods: <ul> <li> _getKey </li> <li> _key </li> </ul> If the receiver's class allows <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)+accessInstanceVariablesDirectly"> +accessInstanceVariablesDirectly </a> it continues with instance variables: <ul> <li> _key </li> <li> key </li> </ul> Public accessor methods: <ul> <li> getKey </li> <li> key </li> </ul> Invokes <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-handleTakeValue$forUnboundKey$"> -handleTakeValue:forUnboundKey: </a> if no accessor mechanism can be found and raises NSInvalidArgumentException if the accessor method takes takes any arguments or the type is unsupported (e.g. structs). </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-takeStoredValue$forKey$">takeStoredValue: forKey: </a></h3> - (void) <b>takeStoredValue:</b> (id)anObject<b> forKey:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Sets the value associated with the supplied in the receiver. The object is converted to the scalar attribute where applicable. Uses the private accessors in favor of the public ones, if the receiver's class allows <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)+useStoredAccessor"> +useStoredAccessor </a> . Otherwise this method invokes <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-takeValue$forKey$"> -takeValue:forKey: </a> . The search order is: <br /> Private accessor methods: <ul> <li> _setKey: </li> </ul> If the receiver's class allows accessInstanceVariablesDirectly it continues with instance variables: <ul> <li> _key </li> <li> key </li> </ul> Public accessor methods: <ul> <li> setKey: </li> </ul> Invokes <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-handleTakeValue$forUnboundKey$"> -handleTakeValue:forUnboundKey: </a> if no accessor mechanism can be found and raises NSInvalidArgumentException if the accessor method doesn't take exactly one argument or the type is unsupported (e.g. structs). If the receiver expects a scalar value and the value supplied is the NSNull instance or <code>nil</code>, this method invokes <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-unableToSetNilForKey$"> -unableToSetNilForKey: </a> . </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-takeStoredValuesFromDictionary$">takeStoredValuesFromDictionary: </a></h3> - (void) <b>takeStoredValuesFromDictionary:</b> (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*)aDictionary;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Iterates over the dictionary invoking <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-takeStoredValue$forKey$"> -takeStoredValue:forKey: </a> on the receiver for each key-value pair, converting NSNull to <code>nil</code>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-takeValue$forKey$">takeValue: forKey: </a></h3> - (void) <b>takeValue:</b> (id)anObject<b> forKey:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Sets the value if the attribute associated with the key in the receiver. The object is converted to a scalar attribute where applicable. Uses the public accessors in favor of the private ones. The search order is: <br /> Accessor methods: <ul> <li> setKey: </li> <li> _setKey: </li> </ul> If the receiver's class allows <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)+accessInstanceVariablesDirectly"> +accessInstanceVariablesDirectly </a> it continues with instance variables: <ul> <li> key </li> <li> _key </li> </ul> Invokes <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-handleTakeValue$forUnboundKey$"> -handleTakeValue:forUnboundKey: </a> if no accessor mechanism can be found and raises NSInvalidArgumentException if the accessor method doesn't take exactly one argument or the type is unsupported (e.g. structs). If the receiver expects a scalar value and the value supplied is the NSNull instance or <code>nil</code>, this method invokes <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-unableToSetNilForKey$"> -unableToSetNilForKey: </a> . <br /> Deprecated... use <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-setValue$forKey$"> -setValue:forKey: </a> instead. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-takeValue$forKeyPath$">takeValue: forKeyPath: </a></h3> - (void) <b>takeValue:</b> (id)anObject<b> forKeyPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Retrieves the object returned by invoking <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-valueForKey$"> -valueForKey: </a> on the receiver with the first key component supplied by the key path. Then invokes <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-takeValue$forKeyPath$"> -takeValue:forKeyPath: </a> recursively on the returned object with rest of the key path. The key components are delimited by '.'. If the key path doesn't contain any '.', this method simply invokes <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-takeValue$forKey$"> -takeValue:forKey: </a> . <br /> Deprecated... use <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-setValue$forKeyPath$"> -setValue:forKeyPath: </a> instead. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-takeValuesFromDictionary$">takeValuesFromDictionary: </a></h3> - (void) <b>takeValuesFromDictionary:</b> (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*)aDictionary;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Iterates over the dictionary invoking <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-takeValue$forKey$"> -takeValue:forKey: </a> on the receiver for each key-value pair, converting NSNull to <code>nil</code>. <br /> Deprecated... use <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-setValuesForKeysWithDictionary$"> -setValuesForKeysWithDictionary: </a> instead. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-unableToSetNilForKey$">unableToSetNilForKey: </a></h3> - (void) <b>unableToSetNilForKey:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Deprecated... use <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-setNilValueForKey$"> -setNilValueForKey: </a> instead. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-validateValue$forKey$error$">validateValue: forKey: error: </a></h3> - (BOOL) <b>validateValue:</b> (id*)aValue<b> forKey:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey<b> error:</b> (out <a rel="gsdoc" href="NSError.html#class$NSError">NSError</a>**)anError;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns a boolean indicating whether the object pointed to by <var>aValue</var> is valid for setting as an attribute of the receiver using the name <var>aKey</var>. On success (<code>YES</code> response) it may return a new value to be used in <var>aValue</var>. On failure (<code>NO</code> response) it may return an error in <var>anError</var>. <br /> The method works by calling a method of the receiver whose name is of the form validateKey:error: if the receiver has implemented such a method, otherwise it simply returns <code>YES</code>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-validateValue$forKeyPath$error$">validateValue: forKeyPath: error: </a></h3> - (BOOL) <b>validateValue:</b> (id*)aValue<b> forKeyPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey<b> error:</b> (out <a rel="gsdoc" href="NSError.html#class$NSError">NSError</a>**)anError;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns the result of calling <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-validateValue$forKey$error$"> -validateValue:forKey:error: </a> on the receiver using aPath to determine the key value in the same manner as the <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-valueForKeyPath$"> -valueForKeyPath: </a> method. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-valueForKey$">valueForKey: </a></h3> - (id) <b>valueForKey:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns the value associated with the supplied key as an object. Scalar attributes are converted to corresponding objects. <br /> The search order is: <br /> Accessor methods: <ul> <li> getKey </li> <li> key </li> </ul> If the receiver's class allows <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)+accessInstanceVariablesDirectly"> +accessInstanceVariablesDirectly </a> it continues with private accessors: <ul> <li> _getKey </li> <li> _key </li> </ul> and then instance variables: <ul> <li> key </li> <li> _key </li> </ul> Invokes <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-setValue$forUndefinedKey$"> -setValue:forUndefinedKey: </a> if no accessor mechanism can be found and raises NSInvalidArgumentException if the accessor method takes any arguments or the type is unsupported (e.g. structs). </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-valueForKeyPath$">valueForKeyPath: </a></h3> - (id) <b>valueForKeyPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns the object returned by invoking <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-valueForKeyPath$"> -valueForKeyPath: </a> recursively on the object returned by invoking <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-valueForKey$"> -valueForKey: </a> on the receiver with the first key component supplied by the key path. The key components are delimited by '.'. If the key path doesn't contain any '.', this method simply invokes <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-valueForKey$"> -valueForKey: </a> . </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-valueForUndefinedKey$">valueForUndefinedKey: </a></h3> - (id) <b>valueForUndefinedKey:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aKey;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Invoked when <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-valueForKey$"> -valueForKey: </a> / <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-storedValueForKey$"> -storedValueForKey: </a> are called with a key, which can't be associated with an accessor method or instance variable. Subclasses may override this method to add custom handling. NSObject raises an NSUndefinedKeyException, with a userInfo dictionary containing NSTargetObjectUserInfoKey with the receiver an NSUnknownUserInfoKey with the supplied key entries. <br /> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSKeyValueCoding)-valuesForKeys$">valuesForKeys: </a></h3> - (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*) <b>valuesForKeys:</b> (<a rel="gsdoc" href="NSArray.html#class$NSArray">NSArray</a>*)keys;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Iterates over the array sending the receiver <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-valueForKey$"> -valueForKey: </a> for each object in the array and inserting the result in a dictionary. All <code>nil</code> values returned by <a rel="gsdoc" href="#method$NSObject(NSKeyValueCoding)-valueForKey$"> -valueForKey: </a> are replaced by the NSNull instance in the dictionary. </div> <hr width="25%" align="left" /> </div> <br /> <a href="Base.html">Up</a> </font> </body> </html>