Passing value from one class to another
I am newbie to Objective C. I want to pass th开发者_Go百科e value of the text field from one screen to other screen and want to display it in 2nd screen.
Way 1:
- If its key data that is needed application wise store it in app delegate
Way 2:
- When you switch UI , you create new object of secondView's controller use setter getters to set it in second controller.
For example:
WelcomeView *welcome= [[WelcomeView alloc] initWithFrame: rect];
[welcome setParam:someParam];
[mainView addSubview: welcome];
- Detailed How to switch the views
精彩评论