i have a button that is created programmatic and i need to perform a segue on click that will send data with prepareForSegue, but this code wont trigger it.
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
UIViewController * vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"AddToCalendarViewController"];
[self.navigationController pushViewController:vc animated:YES];
i have tried this:
[self performSegueWithIdentifier:@"addToCalendar" sender:self];
but since the button is created grammatically i don't have any segue identifier to call, and using the following to create it did not work
UIStoryboardSegue * segue = [[UIStoryboardSegue alloc] initWithIdentifier:@"addtoCalendar" source:self destination:vc];