Note that there are some explanatory texts on larger screens.

plurals
  1. POMove from one controller to another with segue and story boards
    text
    copied!<p>I have finished the first tutorial in the apple developer tool resources where you make an input, label and button what I want is to make it so when you press the button it takes you to a new scene so i have set up the segue, and i'd it as "testPush" now how do i actually get it to move when i push the button i get an error saying</p> <pre><code>**Thread 1: signal SIGABRT** </code></pre> <p>And the code that it is replying to is this</p> <pre><code>return UIApplicationMain(argc, argv, nil, NSStringFromClass([HelloWorldAppDelegate class])); </code></pre> <p>Anyone got any idea's i know u need to add in code for the segue to work however everything i have seen doesn't make sense or its jsut a block of code with little to none instruction on what it means how u get it to work etc. Thanks for any and all help</p> <p>Other stuff you might need i'm not to sure Scene one is called: HelloWorldViewController Scene two is called: HelloWorldViewController2</p> <p>EDIT</p> <p>Heres the code from my scripts encase you need that thanks. HelloWorldViewController.m</p> <pre><code> #import "HelloWorldViewController.h" @interface HelloWorldViewController () @property (weak, nonatomic) IBOutlet UITextField *textField; @property (weak, nonatomic) IBOutlet UILabel *label; - (IBAction)changeGreeting:(id)sender; @end @implementation HelloWorldViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (IBAction)changeGreeting:(id)sender { self.userName = self.textField.text; NSString *nameString = self.userName; if ([nameString length] == 0) { nameString = @"World"; } NSString *greeting = [[NSString alloc] initWithFormat:@"Hello, %@!", nameString]; self.label.text = greeting; } - (BOOL)textFieldShouldReturn:(UITextField *)theTextField { if (theTextField == self.textField) { [theTextField resignFirstResponder]; } return YES; } @end </code></pre> <p>HelloWorldViewController.h</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface HelloWorldViewController : UIViewController &lt;UITextFieldDelegate&gt; @property (copy,nonatomic) NSString *userName; @end </code></pre> <p>And main.m</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; #import "HelloWorldAppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([HelloWorldAppDelegate class])); } } </code></pre>
 

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