Associative array/Creation: Difference between revisions

Content added Content deleted
(→‎version 2: expanded the first boxed comment for clarifiction of use. -- ~~~~)
Line 955: Line 955:
[NSNull null], @"extra",
[NSNull null], @"extra",
nil];</lang>
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:
To create a mutable dictionary, use NSMutableDictionary: