简体   繁体   中英

I have a UITextField in a controller,after text something in it like“a”,I press a UITableviewcell or a button or something else to push a n

I have a UITextField in a controller,after text something in it like“a”,I press a UITableviewcell or a button or something else to push a new controller using

   LSIncreaseTypeController *profileViewController = [[LSIncreaseTypeController alloc] initWithShopName:name];

[self.navigationController pushViewController:profileViewController animated:YES];[profileViewController release];

then in profileViewController ,I use

 [self.navigationController popViewControllerAnimated:YES];

to back to the first controller ,but here is the question:sometime the textfeild.text remain "a" and sometime textfeild.text="" ,the "a" gone ,I don"t know why? could someone help me?

If the text is disappearing that you might want to check to see if the First view is getting released unknowingly.

If the view is released and recreated you will loose the text that was entered into the text field.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM