Это мой код.
Здесь создайте наблюдателя для уведомления под названием Example
в ViewController
- (void)addObserverExample
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(example:)
name:@"Example"
object:nil];
}
- (void)example:(NSNotification *)notification{
NSLog(@"Example!!!");
}
С viewDidLoad
зарегистрировать моего наблюдателя
- (void)viewDidLoad
{
[self addObserverExample];
}
В моем втором ViewController. При нажатии на кнопку извините этот код:
[[NSNotificationCenter defaultCenter] postNotificationName:@"Example" object:self.dictKeys userInfo:nil];
У меня проблема в том, что уведомление никогда не выполняется.
Любая идея.