注册通知
[[NSNotificationCenterdefaultCenter] addObserver:selfselector:@selector(changeLabelText:)name:@”ChangeLabelTextNotification”object:nil];
通知方法:
-(void)changeLabelText:(NSNotification *)notification{
id text = notification.object;
UILabel *label = (UILabel*)[self.viewviewWithTag:102];
label.text = text;
}
通知的调用:
[[NSNotificationCenterdefaultCenter]postNotificationName:@”ChangeLabelTextNotification”object:self._textField.text];
原文链接:http://blog.csdn.net/g2321514568/article/details/26847021