Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
NSDictionary *myDict = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithInt:13], @"hello",
|
||||
[NSNumber numberWithInt:31], @"world",
|
||||
[NSNumber numberWithInt:71], @"!", nil];
|
||||
|
||||
// iterating over keys:
|
||||
for (id key in myDict) {
|
||||
NSLog(@"key = %@", key);
|
||||
}
|
||||
|
||||
// iterating over values:
|
||||
for (id value in [myDict objectEnumerator]) {
|
||||
NSLog(@"value = %@", value);
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
NSDictionary *myDict = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithInt:13], @"hello",
|
||||
[NSNumber numberWithInt:31], @"world",
|
||||
[NSNumber numberWithInt:71], @"!", nil];
|
||||
|
||||
// iterating over keys:
|
||||
NSEnumerator *enm = [myDict keyEnumerator];
|
||||
id key;
|
||||
while ((key = [enm nextObject])) {
|
||||
NSLog(@"key = %@", key);
|
||||
}
|
||||
|
||||
// iterating over values:
|
||||
enm = [myDict objectEnumerator];
|
||||
id value;
|
||||
while ((value = [enm nextObject])) {
|
||||
NSLog(@"value = %@", value);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
NSDictionary *myDict = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithInt:13], @"hello",
|
||||
[NSNumber numberWithInt:31], @"world",
|
||||
[NSNumber numberWithInt:71], @"!", nil];
|
||||
|
||||
// iterating over keys and values:
|
||||
[myDict enumerateKeysAndObjectsUsingBlock: ^(id key, id value, BOOL *stop) {
|
||||
NSLog(@"key = %@, value = %@", key, value);
|
||||
}];
|
||||
Loading…
Add table
Add a link
Reference in a new issue