Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your code is ... strange. Try to use class name beginning with a capital letter with an human readable name.</p> <p>Why do you use modal view controller instead of navigation controller?</p> <p>Try this kind of code:</p> <p>EditViewController.h</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; #import "ShowViewController.h" @interface EditViewController : UIViewController { IBOutlet UITextField *textField; } @property(nonatomic,retain)IBOutlet UITextField *textField; -(IBAction)submit; @end </code></pre> <p>EditViewController.m</p> <pre><code>#import "EditViewController.h" @implementation EditViewController @synthesize textField; - (BOOL)textFieldShouldReturn:(UITextField *)theTextField { [theTextField resignFirstResponder]; return YES; } - (void)viewDidUnload { // Release any retained subviews of the main view. self.textField = nil; } - (void)dealloc { [super dealloc]; } -(IBAction)submit { ShowViewController *showViewController = [[ShowViewController alloc] initWithNibName:@"ShowViewController" bundle:nil]; showViewController.string = textField.text; [self.navigationController pushViewController:showViewController animated:YES]; } @end </code></pre> <p>ShowViewController.h</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface new : ShowViewController { } @property(nonatomic,retain)IBOutlet UITextField *txtField; @property(nonatomic,retain)NSString *string; -(IBAction)back; @end </code></pre> <p>ShowViewController.m</p> <pre><code>#import "ShowViewController.h" @implementation ShowViewController @synthesize string; - (void)viewDidLoad { [super viewDidLoad]; txtField.text = string; } - (void)dealloc { [super dealloc]; } -(IBAction)back { [self.navigationController popViewControllerAnimated:YES]; } @end </code></pre> <p>In your MainWindow.xib add a Navigation Controller (or create your project with the navigation controller wizard.</p> <p>If you doesn't want a nab bar just add a</p> <pre><code>[navigationController setNavigationBarHidden:YES animated:NO]; </code></pre> <p>in your application delegate.</p>
 

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