別のセグエが終了したときにセグエを正しく呼び出すことができないのはなぜですか? 私のコードが間違っているか、呼び出すことができないと思いますか?
- (IBAction)optionTapped
{
if (greeting)
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alerta!" message:@"something.." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show];
[self performSegueWithIdentifier:@"firstSegue" sender:itemToSent];
greeting = NO;
}
else
{
[self performSegueWithIdentifier:@"anotherSegue" sender:nil];
}
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"anotherSegue"]) {
UIViewController *viewController = segue.destinationViewController;
OptionsViewController *controller = (OptionsViewController *)viewController;
controller.delegate = self;
} else if ([segue.identifier isEqualToString:@"firstSegue"]) {
UINavigationController *navigationController = segue.destinationViewController;
CCGetViewController *controller = (CCGetViewController *)navigationController.topViewController;
controller.delegate = self;
controller.itemToSent = sender;
}
- (void)firstSegueViewController:(CCGetViewController *)controller didFinishAddItem:(InfoListItems *)item
{
itemToSent = item;
[self dismissViewControllerAnimated:YES completion:nil];
if (scanTap) {
[self scanTapped];
} else if(infoTap){
[self optionTapped];
}
}
もう1つ、「firstSegue」はNavigationControllerに埋め込まれており、「anotherSegue」は単なるビューコントローラーです。