-
-
Save jenhausu/088a44acadb4e7f07c40ffa762071c28 to your computer and use it in GitHub Desktop.
Array & Dictionary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSArray *a = @[@"First",@"Second",@"Third"]; | |
| NSMutableArray *a2 = [[NSMutableArray alloc]initWithObjects:@"First",@"Second",@"Third",nil]; | |
| [a2 addObject:@"Fourth"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let array = ["First","Second","Third"] | |
| var array = ["First","Second","Third"] | |
| array.append("Forth") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSDictionary *d = [[NSDictionary alloc] initWithObjectsAndKeys:@"Value1", @"Key1", @"Value2", @"Key2", nil]; | |
| NSMutableDictionary *d2 = [[NSMutableDictionary alloc]initWithObjectsAndKeys:@"Value1", @"Key1", @"Value2", @"Key2", nil]; | |
| [d2 setObject:@"Value3" forKey:@"Key3"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let dictionary = ["Item 1": "description", "Item 2": "description"] | |
| var dictionary = ["Item 1": "description", "Item 2": "description"] | |
| dictionary["Item 3"] = "description" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment