From Bviewcontroller to Aviewcontroller
In the BViewController.h
#import <UIKit/UIKit.h>
@protocol iddelegate <NSObject>
-(void) Setidvalue: (NSString *) value;
@end
@interface Bviewcontroller:uiviewcontroller
@end
In the bviewcontroller.m
#import "BViewController.h"
@interface Bviewcontroller ()
@property (nonatomic, retain) id<iddelegate> iddelegate; Registering an agent
@end
And then when you need to jump,Aviewcontroller *a = [Self.navigationController.viewControllers objectatindex: SELF.NAVIGATIONCONTROLLER.VIEWCONTROLLERS.COUNT-2];
Self.iddelegate = A; Here and Aviewcontroller interaction, the next code is the corresponding assignment
[Self.iddelegate Setidvalue:stringvalue];
[Self.navigationcontroller POPTOVIEWCONTROLLER:QVC animated:true];
InAViewController.hIn
#import "BViewController.h"//Import protocol
@interface aviewcontroller:uiviewcontroller<iddelegate>//Compliance Agreement
@property (Strong, nonatomic) Uitextfield *contactidfield;
-(void) Setidvalue: (NSString *) value;
@end
In the aviewcontroller.m
-(void) Setidvalue: (NSString *) value//implementation method
{
Self.contactIdField.text = value;
}
Proxy pass-through value (B->A)