Note that there are some explanatory texts on larger screens.

plurals
  1. POSegues not working programmatically
    text
    copied!<p>I migrated a project from using XIB's to Storyboard, according to these instructions: <a href="https://stackoverflow.com/a/9708723/2604030">https://stackoverflow.com/a/9708723/2604030</a> It went good. But I can't make the segues work programmatically, and I need to use them this way, because I have 2 buttons that link to the same ViewController, with different types, hope you understand why from this image. </p> <p><img src="https://i.stack.imgur.com/xYjOr.png" alt="enter image description here"> There are 2 difficulty mode buttons. The code I use: </p> <pre><code>`- (IBAction)btnNormalAct:(id)sender { LevelController *wc = [[LevelController alloc] initWithNibName:@"LevelController" type:0]; [self.navigationController pushViewController:wc animated:YES]; } - (IBAction)btnTimedAct:(id)sender { LevelController *wc = [[LevelController alloc] initWithNibName:@"LevelController" type:1]; [self.navigationController pushViewController:wc animated:YES]; }` </code></pre> <p>This worked when I used XIB's, and I am sure I linked everything correctly in the storyboard's VCs. The seagues works if I make them from the storyboard. But how can I manage this situation.</p> <p><strong>ALSO:</strong> are those lines good when changing from XIB's to Storyboard? Is that the right way to do this change (the way shown in the link above)?</p> <pre><code> - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; } </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