Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to pass test filed value from one view to other?
    primarykey
    data
    text
    <p>I am making an application were i have two pages :</p> <p>page1</p> <p>in which i have 1 textfield and one submit button.</p> <p>when user enter the value in a text field,the value entered in a textfiled should get display on next page.</p> <p>page2 have 1 textfield to display the value ,entered in a first page and an edit button,to edit the text if he want's</p> <p>if he click on edit button he should move to page one,were he can see the value he has entered and should change</p> <p>I am able to pass textfield value from one page to other but not able to display the same value on page one when user click the edit button..</p> <p>following is my page1 .h file</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; #import "new.h" @interface tryViewController : UIViewController { IBOutlet UITextField *textField; } @property(nonatomic,retain)IBOutlet UITextField *textField; -(IBAction)submit; @end </code></pre> <p>following is my page1 .m file:</p> <pre><code>#import "tryViewController.h" @implementation tryViewController @synthesize textField; - (BOOL)textFieldShouldReturn:(UITextField *)theTextField { [theTextField resignFirstResponder]; return YES; } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [super dealloc]; } -(IBAction)submit { new *pg = [new alloc]; pg.str = textField.text; [self .view addSubview:pg.view]; [self presentModalViewController:pg animated:YES]; } @end </code></pre> <p>following is my page2 .h file:</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; #import "tryViewController.h" @interface new : UIViewController { IBOutlet UITextField *txtField; NSString *str; } @property(nonatomic,retain)IBOutlet UITextField *txtField; @property(nonatomic,retain)NSString *str; -(IBAction)back; @end following is my page2 .m file: #import "new.h" @implementation new @synthesize str; - (void)viewDidLoad { txtField.text = str; [super viewDidLoad]; } - (void)dealloc { [super dealloc]; } -(IBAction)back { } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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