开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜