Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to access previous view elements in UINavigationController
    primarykey
    data
    text
    <p>I have a UINavigationController in which I am loading different view controllers. I want to know how can i access the elements (like labels etc) of my previous view. Here is an eg.</p> <p>View A myLabel.text = @"first view";</p> <p>(User moves to view B)</p> <p>View B (user entered a message, that i need to display in View A) something like ViewA.myLabel.text = @"user entered message"</p> <p>I tried many things but was not able to find anything very useful. Please help..</p> <p>I am using Xcode 4 without ARC and without storyboard.</p> <p>Thanks Sam</p> <hr> <p>Edited:</p> <p>I want to update the property declared in viewController of View A and not the labels directly. My labels get updated using that property. Like while pushing the viewController we can pass the values as below.</p> <pre><code>ViewA *myView = [[ViewA alloc] init]; myView.title = @"View B" ; myView.tableView.tag = 3; myView.myTextView.text = @"Some Text"; [self.navigationController pushViewController:myView animated:YES]; [myView release]; </code></pre> <p>Is there any way to pass these values to properties of ViewController of ViewA while popping ViewB and returning back to ViewA ?</p> <p>The actual scenario is as follows: the user gets and option to write a message in textView or he can use the predefined templates. If he clicks on the templates button he is taken to a list of predefined templates where he can select any of the predefined message. Now I want that when the user click on any of the predefined message the view containing the list of predefined message gets popped of and the message he selected gets automatically populated in the textView of main view. what is the best approach to achieve this ?</p> <p>TIA Sam</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload