Anonymous user
Associative array/Creation: Difference between revisions
m
→{{header|Objective-C}}
(→version 2: expanded the first boxed comment for clarifiction of use. -- ~~~~) |
|||
Line 955:
[NSNull null], @"extra",
nil];</lang>
The same as the above with the new literal syntax in clang 3.1+ / Apple LLVM Compiler 4.0+ (XCode 4.4+) :
<lang objc>
NSDictionary *dict = @{
@"name": @"Joe Doe",
@"age": @42,
@"extra": [NSNull null],
};</lang>
To create a mutable dictionary, use NSMutableDictionary:
|