jjzjj

defaultCenter

全部标签

ios - 我如何监听发送到 iOS NSNotificationCenter 的 defaultCenter 的所有通知?

我想收听发送到defaultCenter的所有通知。公共(public)和私有(private)。有谁知道我该怎么做? 最佳答案 使用NSNotificationCenter的addObserverForName:object:queue:usingBlock:或者addObserver:selector:name:object:方法并为名称和对象传递nil。例子下面的代码应该可以完成这项工作:-(void)dumpNotifications{NSNotificationCenter*notifyCenter=[NSNotifica
12