Xcode: storyboard and data storage in each controller

As you can guess, I'm a new programmer, and I'm having trouble getting a simple thing! I am making an application with multiple controllers. Each controller has text fields and UIsegmentedControl elements. When I switch from one view controller to another (if that matters), the contents of the previous one (text fields and segmented control parameter) are reset. How can I make them keep their previous state? Thanks in advance.

+5
source share
3 answers
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
    bViewController *deneme = [segue destinationViewController];
    [deneme setPassedValue:label.text];
}

This piece of code will solve your problem, I hope. He retains the mark of what is inside her. And you need to add some more codes for other classes.

, .

+2

, , MVC (-view-controller) . :

viewWillDisappear: , viewWillAppear:.

viewWillDisappear: , viewWillAppear: , - .

, , , , : http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html

0
0

All Articles