Note that there are some explanatory texts on larger screens.

plurals
  1. POIOS 5 - Call a ViewController from another ViewController
    primarykey
    data
    text
    <p>As I'm very new to IOS development, I don't really know all the mechanisms that are to be used while developing iPhone apps.</p> <p>Here, what I'm trying to do is to call another controller after performing a segue.</p> <p>The context : </p> <p>I have my first page, which basically consists on a login page, with a user/password system. I created a segue which is called by clicking on the Submit button. Here's the code :</p> <pre><code>- (IBAction)Connect:(UIButton *)sender { NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: @"passwordsample", @"usernamesample", nil]; if ((![[dict allKeys] containsObject:TFLogin.text])) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Login or password incorrect" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [alert show]; NSLog(@"Connection Not OK"); } else { [self performSegueWithIdentifier:@"LoginSegue" sender:sender]; NSLog(@"Connection OK"); } } </code></pre> <p>And here's the prepareForSegue function :</p> <pre><code>- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { HomeController *home = (HomeController *) segue.destinationViewController; home.sentLogin = TFLogin.text; } </code></pre> <p>The fact is that, when I click on the Submit button (on the login page), the logs show me that the user is correctly found, and then I get the error as following :</p> <pre><code>2012-04-30 11:24:44.630 AppName[1066:f803] -[UINavigationController setSentLogin:]: unrecognized selector sent to instance 0x6d73c30 2012-04-30 11:24:44.630 AppName[1066:f803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UINavigationController setSentLogin:]: unrecognized selector sent to instance 0x6d73c30' </code></pre> <p>Here's the storyboard :</p> <p><img src="https://i.stack.imgur.com/jYYfg.png" alt="Storyboard"></p> <p><em>The second NavigationController is to be replaced with a Tab Bar Controller. But for some testing, I've put this one.</em></p> <p>Could someone please guide me, telling me what I'm doing wrong and/or sending me some recent guides on storyboarding and navigation ? </p> <p>Thanks a lot !</p>
    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.
 

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