Created
March 1, 2013 17:27
-
-
Save isutton/5066265 to your computer and use it in GitHub Desktop.
`valueForKeyPath` example
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
#import <Foundation/Foundation.h> | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
NSArray *array = @[ | |
@{@"name": @"Igor"}, | |
@{@"name": @"Tom"}, | |
@{@"name": @"Matt"}, | |
@{@"name": @"Mike"} | |
]; | |
NSArray *names = [array valueForKeyPath:@"name"]; | |
NSLog(@"names = %@", names); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment