Help with random numbers

Discussion in 'Public Game Developers Forum' started by Drenguin, Feb 8, 2009.

  1. Drenguin

    Drenguin Well-Known Member

    Jan 10, 2009
    87
    0
    0
    Okay I tried that and nothing happened here is the action that is called when the user hits a button.
    Code:
    - (IBAction)userIsDone:(id)sender
    {
    	oneField.text=oneLabel.text;
    }
     
  2. Drenguin

    Drenguin Well-Known Member

    Jan 10, 2009
    87
    0
    0
    Sorry forget the last post I made I messed up, its working now.
     
  3. Drenguin

    Drenguin Well-Known Member

    Jan 10, 2009
    87
    0
    0
    I have got my program changing views thanks to your tutorial! But, I've run into another problem. I am trying to take information a user typed into a text field and display it in a label in the second view. How do I move this information over to the second view?
     
  4. Schenk Studios

    Schenk Studios Well-Known Member

    If the second view is a child view of the first one. i.e. the first one calls the second one into being with

    [self presentModalViewController:secondView animated:YES];

    Then you could write a simple method in the second View.

    - (void)switchText:text{
    label.text = text;
    }

    You'd call that method in the first view controller

    [secondViewController switchText:textField.text];

    OR

    You may find it easier to make an IBOutlet for that label in your first view controller, and hook it up accordingly. You always need to be careful with this though as sometimes it can lead to crash city if you go overboard with it.
     

Share This Page