Help with textField....accessing property in another view
Hi
I have an application with a two text fields in one view(view1) and two labels in another view ( view2). I have a button in view1, when it is pressed it loads view2 and I want to change the label to the text that i entered in the text field. How can I do it?........... i have read somewhere in the forum about delegates and all, I read in details but I was not able to figure out how to use it.
Hi
I have an application with a two text fields in one view(view1) and two labels in another view ( view2). I have a button in view1, when it is pressed it loads view2 and I want to change the label to the text that i entered in the text field. How can I do it?........... i have read somewhere in the forum about delegates and all, I read in details but I was not able to figure out how to use it.
Can anyone provide me a sample code?
Thanks in Advance
-John
I think you are invoking the second view (view2) in the following manner.
I have another requirement like, am having two views and i have one label in View1 and a button. When button pressed my view navigating to view2, there i have one text field. After entering value in text field am submitting View2 button. This time my view1 label is getting updated (When we do the code in above method). But whenever am submitting view1 button and updating the label, new View1 is creating..ie.View1 not getting updated..
I have another requirement like, am having two views and i have one label in View1 and a button. When button pressed my view navigating to view2, there i have one text field. After entering value in text field am submitting View2 button. This time my view1 label is getting updated (When we do the code in above method). But whenever am submitting view1 button and updating the label, new View1 is creating..ie.View1 not getting updated..
I am trying to accomplish something similar, but have started using the Utility Application template and the view is invoked in a different manner. I've noted many have said it is a rather over-complicated template for a simple transition... however, I am quite far through the build process and not sure if I want to start fresh using a different template!
What changes would need to be made to this code to get it working on the Utility Application template?
I have a textField in the flipside view and I would like the text entered to be applied to a label in the main view?
I'm going to try to answer my own question using NSDefaults... my flipside is for settings that will remain largely unchanged... once I have got some working code I'll post it up... I hope it will help others...
Thanks for posting that John. Yes it did work well for me with passing both floats and strings between screens to update content. Looks like that link has all the example code you would want, so I won't worry about posting mine unless anyone specifically requests?!
Talking about NSDefaults... quick question for anyone that knows...
My data that is saved to NSDefaults seems to persist... even following a power cycle... the books I have read talk about several methods for preserving data but NSDefaults is not one of them... I assume there is a good reason for this? Is it not backed up to iTunes for example? I assume everything should be stored in an archive or array properly...