开发者

NSNotificationCenter selector arguments

开发者 https://www.devze.com 2023-03-28 15:05 出处:网络
I want to call not just methods from NSNotification but the method\'s arguments Something along the lines of

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

精彩评论

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