The easiest way is to create your own class and set the value from the controller to the user class, and then get the value from the user class to the controller.
Sample code here:
First create a custom class like
AppUtility.h
+(void)setXxxName:(NSString *)str; +(NSString *)getXxxName;
AppUtility.m
static NSString *xxxname; +(void)setXxxName:(NSString *)str{ xxxname=str; } +(NSString *)getXxxName{ return xxxname; }
FirstController.m
import custom class into controller
#import "AppUtility.h"
set the value from the first controller to the user class, use the code below to set the value:
[AppUtility setXxxName:@"xyz"];
Second .m controller
import custom class into controller
#import "AppUtility.h"
get the value from the user class here, use the code below to get the value:
NSString *str = [AppUtility getXxxName];
In the appUtility class Use nslog statements to check if values ββare correct or not
user2998756
source share