Content deleted Content added
→Objective-C (Cocoa/GNUstep): copy editing and linking |
→Objective-C (Cocoa/GNUstep): copy editing and (crudely) referencing |
||
Line 1,073:
===Objective-C (Cocoa/GNUstep) ===
[[Cocoa (API)|Cocoa]] and [[GNUstep]], written in [[Objective-C]], handle associative arrays using <code>NSMutableDictionary</code> (a mutable version of <code>NSDictionary</code>) class cluster. This class allows assignments between any two objects. A copy of the key object is made before it is inserted into <code>NSMutableDictionary</code>, therefore the keys must conform to the <code>NSCopying</code> protocol. When being inserted to a dictionary, the value object receives a retain message to increase its reference count. The value object will receive the release message when it will be deleted from the dictionary (
<syntaxhighlight lang=ObjC>
Line 1,082:
</syntaxhighlight>
To access assigned objects, this command may be used:
<syntaxhighlight lang=ObjC>
Line 1,088:
</syntaxhighlight>
All keys or values can be
<syntaxhighlight lang=ObjC>
Line 1,099:
</syntaxhighlight>
<syntaxhighlight lang=ObjC>
Line 1,122:
</syntaxhighlight>
<syntaxhighlight lang=ObjC>
|