【发布时间】:2017-06-15 17:19:19
【问题描述】:
我在A班:
-(void)threewaysbuttonshow:(NSNotification *)notification {
NSLog(@" Do something ");
}
在我的 B 类中,我想调用我的函数,它是 A 类中的threewaysbuttonsho。
我正在考虑使用 NSNotificationCenter。这是我在 B 类中的代码,但在代码运行时它不会调用我的函数,任何帮助表示感谢。
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(threewaysbuttonshow:) name:@"something" object:nil];
【问题讨论】:
标签: objective-c notifications nsnotificationcenter