[Solved] Accessing NSString from another .m file [closed]


I just put basic step here, change it as per your requirement.

You just need to write

@property (nonatomic, strong) NSString *userEMail;

in your first.h file

write second.h file

@property (nonatomic, strong) NSString *gotUserEMail;

And your first.m file

you have gotUserEMail string with some value..

pass it to anotherViewController such liek,

secondViewController *addView = [[secondViewController alloc] init];
addView.gotUserEMail = userEMail;

.
.
.
.

EDITE

Okay then you need to use NSUserDefault.

NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setValue:userEMail forKey:@"myEmailString"];
[userDefaults synchronize];

get anywhere in your project by,

NSUserDefaults *data = [NSUserDefaults standardUserDefaults];  
NSString  *gotEmail = [data floatForKey:@"myEmailString"];

3

solved Accessing NSString from another .m file [closed]