/usr/share/GNUstep/Documentation/Developer/Base/Reference/NSKeyValueCoding.html is in gnustep-base-doc 1.24.7-1build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 | <!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>Version:</b> 37814</p>
<p><b>Date:</b> 2014-04-26 19:39:34 +0100 (Sat, 26 Apr 2014)</p>
<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>
|