1. entrustment delegate mode; 2. Notice notification mode, 3.block mode, 4.UserDefault or file mode, 5. single-case mode; 6. By setting properties, the value between pages is achieved 1: a page jumps to page b
Method:
In the controller of the B page, write the corresponding property, in the a page to jump to the B page, the B property assignment can be
Secondviewcontroller.h@property (nonatomic) Nsinteger flag;//current system designation (0: other means of transmission; 1:block pass-through value)
In the attempt controller on page a
rootviewcontroller.m-(ibaction) Showsecondview: (ID) Sender { Secondviewcontroller *second = [[ Secondviewcontroller alloc] initwithnibname:@ "Secondviewcontroller" bundle:nil]; Second.delegate = self; Second.flag = 0; [Self Presentviewcontroller:second animated:yes completion:nil];}
Scenario 2: A page jumps to page B, page b jumps back to page a
Mainstream programmes:
(1) through the way of entrusting delegate to achieve
Set up protocols and methods
Secondviewcontroller.h@protocol secondviewdelegate-(void) ShowName: (NSString *) namestring; @end
Set up the proxy (weak is used here to prevent circular references)
Secondviewcontroller.h@interface Secondviewcontroller:uiviewcontroller@property (nonatomic, weak) id< Secondviewdelegate> delegate; @property (nonatomic, copy) Ablock block; @end
Transferred from: http://www.cnblogs.com/JuneWang/p/3850859.html
iOS Development-page Pass value summary