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

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -