In my app users are required to verify their phone number to register. In the first view, they enter their phone number and receive an SMS. In the second view, they enter the SMS code, and in the third view, they complete their profile.
I am trying to pass the value of the user's phone number from View 1 to View 3.
Please see below:
View1.m
ProfileCreateViewController *pc = [[ProfileCreateViewController alloc] init];
pc.userPhoneNumber = [NSString stringWithFormat:@"%@", self.userPhoneNumber.text];
// Perform segue to View 2
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
EnterCodeViewController* vc = [segue destinationViewController];
vc.verification = _verification;
}
View 3.h
@interface ProfileCreateViewController : UIViewController
.....
@property (nonatomic, strong) NSString *userPhoneNumber;
@end
View3.m
@synthesize userPhoneNumber;
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"My phone number is: +1%@", userPhoneNumber);
}
However, when I get to View3, in the log I am getting 'My phone number is +1(null)'
Why isn't the value passing to View3?