我有iOS应用程序中的对象列表,它使用NSNotificationCenter
观察一些更改。NSNotificationCenter更改观察者订单
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onSomeChanges)
name:@"SomeConstantNotificatioName" object:nil];
所以当通知发布,NSNotificationCenter
调用以相同的顺序onSomeChanges
方法为addObserver
调用方法。
问题是有没有办法改变这个顺序?
我需要的是能够调用一些添加观察者方法,它将插入需要的观察者作为观察者列表的第一个元素。因此,无论观察者添加的顺序如何,某个对象都会首先收到通知。
谢谢
可能dupliacte http://stackoverflow.com/questions/12957590/nsnotification-order-of-observer-notifications –