Could someone please advise me on best or practical way of creating a many to one relationship messaging system. I am new to Objective-C so if this something that I "should know" as an Obj-C developer, please feel free to point me in the right direction on tutorials/documentation.
Currently, I'm working on a Brick Breaker game to learn and get better at Obj-C/Cocos2D/Box2D. I am trying to create an internal messaging system in my BrickMgr class that holds instances of bricks (NSMutableArray). When a brick is destroyed, I want to notify my parent(BrickMgr) the score value of the brick, so that it can then decide how to use or communicate it to the heads-up-display(HUD).
From all the Googling/reading I've done, it seems like KVO or NSNotificationCenter would be the way to go, but all the examples I've read are one-to-many relationship. I am wondering could I do the opposite and use it in the form of many-to-1 relationship.
E.g.: In each instance of my Brick class, when the brick is destroyed I can do
//Brick class, when brick.state = BRICK_DESTROYED
[NSNotificationCenter defaultCenter] postNotificationName:BB_SCORE_CHANGED_NOTIFICATION object:self userInfo:nil];
and in my BrickManager class register my observer to listen to the postNotification
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onScoreChanged:) name:BB_SCORE_CHANGED_NOTIFICATION object:nil];
Please advise.