iphone - NSPredicate query -
iphone - NSPredicate query -
i have used nspredicate before different purpose. stuck in next scenario query.
i have array persons contains person objects i.e persons array of objects. need collect names_ person objects persons array. know can through loop can through nspredicate or more optimize way?
nsmutablearray *names; (int i=0; i<[persons count]; i++) { [names addobject:[[persons objectatindex:i] names_]]; }
this 1 line do,
[personarray valueforkeypath:@"@unionofobjects.name"]
iphone objective-c nspredicate
Comments
Post a Comment