Search code examples
argumentsselectornsnotificationsnsnotificationcenter

NSNotificationCenter selector arguments


I want to call not just methods from NSNotification but the method's arguments Something along the lines of

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerinCombat:YES) name:@"PlayerinCombat" object:nil];

and not just

@selector(playerinCombat:)

just to use with

+ (BOOL)playerinCombat:(BOOL)flag {return flag; if (flag){NSLog(@"Player in Combat.");} if (!flag){NSLog(@"Player not in Combat.");}}

But it won't work. Any ideas?


Solution

  • On second thought userInfo can be used (I think)