I am trying to create a button \'on the fly\' using code, and i want that button to perform segue to a different controller. As far as i know, creating segue programmatical
In Interface Builder, create a segue. Since you can't connect the segue to the button (it doesn't exist yet), simply connect the segue to the starting ViewController. Then, when you create the button:
// ....
[but addTarget:self action:@selector(someMethod) forControlEvents:UIControlEventTouchUpInside];
// ....
And in the someMethod:
-(void)someMethod
{
[self performSegueWithIdentifier:@"segueIdentifier" sender:self];
}