Segues not working programaticly
So, i migrated a project from using XIB's to Storyboard, acording to these
instructions: http://stackoverflow.com/a/9708723/2604030 It went good. But
i can't make the segues work programaticly, 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.
There are 2 dificulty mode buttons. The code i use:
`- (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];
}`
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.
ALSO: 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)?
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle
*)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
}
Thanks a lot !
No comments:
Post a Comment