我正在使用以下方式发送通知:
[[NSNotificationCenter defaultCenter] postNotificationName:@"historyLoaded" object:jsonReturn];
并使用以下方式接收通知:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(manageHistory:) name:@"historyLoaded" object:nil];
那么选择器中的方法就是:
- (void) manageHistory: (NSNotification *) historyData{
NSLog(@"this bit of code was run");
}
由于某种原因,通知没有通过。可以从应用程序的任何位置发送和接收通知吗?