Hi,
I am familiar with the basics of NSNotifcationCenter. I am able to get one view to 'talk' to another view (see below how I'm doing that currently). But I'd really like to send a string from one view to another using NSNotificationCenter. Here's what I have so far:
In the MainViewController.m I have an IBAction:
Code:
- (IBAction) receiveInformation{
NSLog(@"I have received!");
}
which gets called in the viewDidLoad using this:
Code:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveInformation) name:@"pass" object:nil];
In my secondViewController.m I am using this to post the notification:
Code:
[[NSNotificationCenter defaultCenter] postNotificationName:@"pass" object:nil];
So my question is, how can I use NSNotificationCenter to send a string?
Thanks for any help.