i'm new in IOS. i look for solution for over a day but all available solution work within a single UIViewConntroller but when i did it between uiTableView row selection and UIViewConntroller as Observer then the Selector is not called by Observer.
On row Selection in uitableviewcontroller
NSDictionary * dict =[NSDictionary dictionaryWithObject:@"Ravi" forKey:@"name"];
NSNotification * notification =[[ NSNotification alloc] initWithName:@"NOTIFICATION" object:nil userInfo:dict];
**In UIViewController on viewdidload **
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(receivedNotification:)
name:@"NOTIFICATION" object:nil];
**SelectorAction in uiviewcontroller **
-(void) receivedNotification:(NSNotification*) notification
{
NSLog(@"Notification Received ");
}
hi @Abdul Rehman Warraich, i got your problem. you are posting notification in one view, and trying to observe it an another view. but what happens is, in the second view your observer is not ready (not loaded) to get the notification what you sent.
once you landed in the second view, that time itself observer is loaded.so it obviously will miss the notification.
so whenever you do push and pop, observer will loading as new one. so every time it will fail to observe it.
HINT: Try to load observer in your second view , before you fire the notification. Hope it will help you to debug.