PDA

View Full Version : multi tab calculator




Darkjenso
Sep 5, 2011, 12:01 PM
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



ethical
Sep 5, 2011, 06:48 PM
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.

Darkjenso
Sep 5, 2011, 06:56 PM
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!

treestar
Sep 5, 2011, 06:59 PM
I program and I don't find any sense in this thread.

dejo
Sep 5, 2011, 07:04 PM
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".