1、发通知
NSDictionary *myDictionary = [NSDictionary dictionaryWithObject:@”sendValue” forKey:@”sendKey”];
//这里是一个dic格式数据,可以放入各种数据
[[NSNotificationCenter defaultCenter] postNotificationName:@"myNotice" object:nil userInfo:myDictionary];
2、接受通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(noticeMethod:) name:@”myNotice” object:nil];
3、调用方法,接受信息。
- (void)noticeMethod:(NSNotification *)notification
{
//在这里可以得到想要的数据
NSString *getsendValue = [[notification userInfo] valueForKey:@”sendKey”];
}