Segue push not happening

Discussion in 'iOS Programming' started by nashyo, Jan 13, 2012.

  1. nashyo macrumors 6502

    nashyo

    Joined:
    Oct 1, 2010
    Location:
    Bristol
    #1
    Why is it that this code causes the IBAction (Round Rect Button) to execute

    'dissmissModalViewControllerAnimated:YES'

    even if the _currentContent.Answer1Validity is equal to string @"CORRECT!"

    ???

    surely it should execute the segue, as I'm telling it to

    Code:
    - (IBAction)OK:(id)sender 
    {
        if([_currentContent.Answer1Validity isEqualToString:@"CORRECT!"])
        {
            [self performSegueWithIdentifier:@"Correct" sender:self];
        } else {
            [self dismissModalViewControllerAnimated:YES];
        }
    }
    I ctrl dragged a segue from the button to a view controller and selected push. The segue identifier is 'Correct'.
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    How have you checked that this is in fact the case. Try NSLog-ing this before this if statement.
     
  3. nashyo thread starter macrumors 6502

    nashyo

    Joined:
    Oct 1, 2010
    Location:
    Bristol
    #3
    I've abandoned this approach

    I just learned that I should be using protocols for what I'm doing. By far the most difficult concept for me to understand so far.
     

Share This Page