Wednesday, 15 February 2012

IPhone SDK - Passing Variables between views with animations -


Hello I'm new to iPhoneSDK so please take a break with me.

What I basically have is a scene with 10 buttons, whose name is respectively 'one' and 'ten'. What do I want to do when I click on a button (like: 'nine'), then it goes to the second scene with animation, then on that next scene, there is a label that will display the text of which I clicked on the first button (like: I pressed the label 'nine' button on the next page, label 'nine')

If this problem is not high, it will be greatly appreciated that your How each idea works Like Chci.

I basically have my code but it is definitely confusing and false

Conceptually, whatever I tried and learned so far is:

1) I tried animating and switching using ADSView, Add-Siewviews, SetInnation, etc. I managed to switch ideas, but I do not know how to pass the data.

2.) I've learned Push ViewControllers. From the tutorials I saw, I practiced on a hierarchy table. I came to know that there are only UIViewControllers and UITableViewControllers that can be pushed, I know how this applies if it is in a table, but I do not know how it applies to ideas (because in my app screen But buttons are randomly scattered)

If you can give me somehow what I am trying to do, even at least the step-by-step concept For, i I appreciate and thank you all for life. I am working on it for weeks and it is really not a real person to explain to me is difficult.

Please try to use the tag

Give a tag for the button (1 to 10) and when a button is clicked, get the sender's tag so you can know which button was clicked on. Please note, this is only necessary if you use the same method for all button clicks.

To display the next view controller, create a property (click button) type NSString and synthesize it. File.

After receiving the text in a variable based on the clicked button, create a new object of the view controller that appears (I think you already do this) and set the property Click clickedButton of this view controller object.

NewviewController * nController = [[NewviewConverterAloc] initWithNibName: @ "NewView"]; [Encryptor Setlight Button: yourStringVariableWithButtonName]; [[Self-Navigation Controller] Push ViewController: Animated Animator: Yes];

In the newview controller, set the text of the label on the clicked button

  [yourLabel setText: clicked buttons];  

Hope that helps.


No comments:

Post a Comment