我在swift和NSNotificationCenter-System上遇到了一些问题。 我说这样的观察:Swift NSNotificationCenter不会启动
NSNotificationCenter.defaultCenter().addObserverForName("disconnected", object: nil, queue: nil) { note in
self.btConnect.title = "Verbinden"
}
和我张贴这样的通知:
NSNotificationCenter.defaultCenter().postNotificationName("disconnect", object: self)
但没有任何反应。观察者和通知者处于不同类别中。 有人可以帮助我,我做错了什么?