Reputation: 2252
I have an NSArray
called carparkArr that contain MyCarpark
objects. This class contain:
@property (nonatomic, assign) CLLocationCoordinate locationCoord;
Now I want to create an array that will have NSValue
of each of these objects. How to do it quickly? I want something like:
NSArray *carparkArr = // fetching data
NSArray *locationProperty = [self getArrayForPropertyPath:@".locationCoord" forArray:carparkArr];
Upvotes: 2
Views: 56
Reputation: 9731
Yeah that feature already exists:
NSArray *locationProperty = [carparkArr valueForKey:@"locationCoord"];
Upvotes: 2