开发者

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 {retu开发者_Python百科rn flag; if (flag){NSLog(@"Player in Combat.");} if (!flag){NSLog(@"Player not in Combat.");}}

But it won't work. Any ideas?


On second thought userInfo can be used (I think)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜