B to pass a value to a1. There is a block in controller B:typedef void (^myblock) (nsstring* str1,nsstring* str2);str1 and str2 are stored with the parameters to be passed.2. There is also a method that takes block as a parameter-(void) Chuanzhi: (Myblock) block{
Block (Self.textfiled1.text,self.textfiled2.text);}so that Self.textfiled1.text,self.textfiled2.text can be passed as a parameter.3. Call this Chuanzhi method in controller a(1) Import controller A's header file #import "TwoViewController.h"(2) Create the object of controller A to call this Chuanzhi method twoviewcontroller* TWOVC = [[Twoviewcontroller alloc]init];(3) when the controller a page is about to appear, call this Chuanzhi method to complete the pass value. Page will appear
-(void) Viewwillappear: (BOOL) animated{
//Called when the page is about to appear
[TWOVC chuanzhi:^ (NSString *str1, NSString *str2) {
//Get Parameters
Self.textFiled1.text = str1;
Self.textFiled2.text = str2;
}];
}
iOS page (between controllers) a block of values