注册通知 [[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]; |
|