Skip to content

Instantly share code, notes, and snippets.

@isutton
Created March 1, 2013 17:27
Show Gist options
  • Save isutton/5066265 to your computer and use it in GitHub Desktop.
Save isutton/5066265 to your computer and use it in GitHub Desktop.
`valueForKeyPath` example
#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