[[NSNotificationCenter defaultCenter] postNotificationName:kNotificationForbidAdvPost object:nil];
我定义postNotificationName:在.h文件中为什么我不能收到通知
林我的NSApplication的子类kNotificationForbidAdvPost,我导入此.h文件中。并有此通知的观察员
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeToRecordingStatus) name:kNotificationForbidAdvPost object:nil];
我确定观察者先被添加,然后发布通知。
我在调试中看到[UINotification default]。它在两部分代码中具有相同的内存地址。
我有什么错误吗?
谢谢!
愚蠢的问题,但是...你确定你已经注册了通知吗? – 2011-06-15 19:00:44
我确定。在调试模式下,它显示两部分代码在Thread1中运行。 – Solskjaer 2011-06-15 19:07:08
你怎么定义'kNotificationForbidAdvPost'?你有没有得到任何编译器警告? – 2011-06-15 19:08:27