Created
May 13, 2014 08:54
-
-
Save stigi/52d11423d9999ee97aff to your computer and use it in GitHub Desktop.
This file contains 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
// | |
// main.m | |
// nil | |
// | |
// Created by Ullrich Schäfer on 13.05.14. | |
// Copyright (c) 2014 nxtbgthng GmbH. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@interface Object : NSObject | |
@property id property; | |
@end | |
@implementation Object @end | |
int main(int argc, const char * argv[]) | |
{ | |
@autoreleasepool { | |
Object *o1 = [Object new]; | |
Object *o2 = [Object new]; | |
Object *o3 = [Object new]; | |
o2.property = @"2"; | |
NSArray *array = @[o1, o2, o3]; | |
NSArray *result = [array valueForKey:@"property"]; | |
NSLog(@"Result: %@", result); | |
} | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: