Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Darkjenso

macrumors regular
Original poster
Oct 27, 2007
114
0
Okay this is just an example for what i want to build, the actual implementation is a little more complex but it is simply on this bit that i keep hitting a brick wall.

Say I have a tab application with three tabs.on the first tab FirstView has a textbox and a button, on the second tab SecondView has just a textbox and on the third tab, ThirdView has a label.

When the user presses the button, I want the application to zip to ThirdView where the label now has the result of the two textboxes on different views multiplied together.

The button transferring the User to the third view is an added bonus but basically to complete my application this is what I need. Can anyone help me with this?

Regards, Jen
 
Last edited:
How I'd try and go about it is to have two integers in the third view, when the user taps the button the two integers are set according to the text fields. When you navigate to the third view the calculation is done and the label text set.
 
How I'd try and go about it is to have two integers in the third view, when the user taps the button the two integers are set according to the text fields. When you navigate to the third view the calculation is done and the label text set.

could you repost because i really have no idea about how to go around doing this,

Thanks!
 
The issue you are butting heads with is normally solved with something commonly called data persistence. There are a number of ways to code a solution, including singletons, using the app delegate (which is a singleton), NSUserDefaults, or even setting up a property in one class and setting its value in the other instance, among others. As well, there have been a number of threads in this forum that have previously covered this topic. Search for "data persistence" or "sharing values/variables between views".
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.