I just dont understand, I have used notifications a trillon times, but today I cant seem to get notifications to send from a particular object. This is in a view controller...
- (void)buttonPressed:(UIButton*)sender {
NSLog(@"buttonPressed");
[[NSNotificationCenter defaultCenter] postNotificationName:@"test" object:self];
}
and this is in another view controller(in the init)..
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(test:) name:@"test" object:nil];
and the method..
-(void)test:(NSNotification *)notification{
NSLog(@"it works! ");
}
...just standard stuff, now if i post the notification from any other object it works fine, just wont post from this one view controller! It even logs "buttonPressed" so it's not like the button is broken. I just dont get it.
Any ideas?