And then the last call to the iOS page transfer value problem
Transfer Gate---------->ios The value of the agent on the page pass
Next, let's talk about the Nsnotificationcenter value method.
Before we get started, we need to know the KVO pattern first.
Key-value observing (KVO) key-value monitoring
Which means when you tell the notification center a key, he'll do something based on the change in value, or get some data.
It's better to use the last one when you say back.
We're sending a listener on the B controller.
[[Nsnotificationcenter Defaultcenter] postnotificationname:@ "changenamenotification" object:self userInfo:@{@ "name ": Self.textField.text}];
and setting a in the a controller itself is a listener (like a is listening to it at this time, so to understand that a KVO can use multiple monitors.) There is only one controller a)
Specific code
[[Nsnotificationcenter Defaultcenter] addobserver:self selector: @selector (changenamenotification:) name:@ " Changenamenotification "Object:nil";
Then implement Changenamenotification in the A controller: method
-(void) Changenamenotification: (nsnotification*) notification{
Nsdictionary *namedictionary = [notification UserInfo];
Self.textLabel.text = [namedictionary objectforkey:@ "name"];
}
Nsnotificationcenter of several ways of transmitting values to IOS pages