I have an array of foos
and each foo has a NSOrderedSet
of bars
. I want to get an array of all the distinct existent bars ids (each bar has a property called objectID
).
Since there is no @distinctUnionOfOrderedSets
I can do it with:
[foos valueForKeyPath:@"bars.objectID.@distinctUnionOfArrays.self"]
And it works, but since the bars are in a NSOrderedSet
I get multiple times this error:
-[NSMutableArray addObjectsFromArray:]: array argument is not an NSArray
Is there a way to do this without the error? Is it safe to leave like this?