ios - How can I change the text from another view controller? -


i'm trying

signupviewcontroller *useremail=[[signupviewcontroller alloc] init]; useremail.emailaddress.text=email;  

but not working.

it seems emailaddress (assuming uitextfeild) not allocated when called

signupviewcontroller *useremail=[[signupviewcontroller alloc] init]; 

so, nil @ point of init.

better way be, added 1 public property in signupviewcontroller of nsstring. save value in property. below

signupviewcontroller *useremail=[[signupviewcontroller alloc] init]; useremail.emailstring=email; 

in signupviewcontroller.h file add

@property (nonatomic, strong) nsstring *emailstring; 

in signupviewcontroller.m file in view did load

- (void)viewdidload{   //if have not used nib or stroyboard init textfield first  emailaddress.text=emailstring;   } 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -