multi tab calculator

Discussion in 'iOS Programming' started by Darkjenso, Sep 5, 2011.

  1. Darkjenso, Sep 5, 2011
    Last edited: Sep 5, 2011

    Darkjenso macrumors regular

    Oct 27, 2007
    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
  2. ethical macrumors 68000

    Dec 22, 2007
    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.
  3. Darkjenso thread starter macrumors regular

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

  4. treestar macrumors 6502

    Feb 28, 2010
    I program and I don't find any sense in this thread.
  5. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    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".

Share This Page