objective c - NSArray - Filter all monopolies in parent-child relationship for a given player -
i have array of groups, multiple children objects.
a player
can own 1 (and one) child
object. there no link between parent
, player
object.
i filter monopolies given player.
ie: scenario
parent array has 2 groups, group a , group b
1. group (array) a. child.owner = player 1 b. child.owner = nil c. child.owner = nil 2. group b (array) a. child.owner = player 1 b. child.owner = player 2 c. child.owner = player 3
in above scenario, player 1 has monopoly in group a.
how use nspredicates give me list of monopolies given player has?
many thanks
Comments
Post a Comment