Tuesday, April 22, 2014

Create an NSArray from Properties of the Items in NSArray

It is possible to create a new NSArray from properties of an NSArray of objects by the following command.

NSArray *licensePlates = [myCars valueForKeyPath:@"licensePlate"]
This is useful when we are only interested in a particular property of a class.
(Source: stackoverflow)

No comments:

Post a Comment