문제

I am developing a storyboard-based application, using XCode 4.2. I'm new to storyboards, before that I used to switch views by creating a new instance of a class like this:

if (x==1)
{    
    theClass *theView ;
    theView= [[theClass alloc] initWithNibName:nil bundle:nil];
    [theView setText:theText];
    [reader presentModalViewController:theClass animated:YES]; //where reader is an instance of the ZBar library
}

With storyboards, here is the code I am trying:

if (x==1)
{
    [self performSegueWithIdentifier: @"theNewView" sender: self];
}

then:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([[segue identifier] isEqualToString:@"theNewView"])
    {
        [[segue destinationViewController] setText:theText];
        [reader presentModalViewController:[segue destinationViewController] animated:YES];
    }
}

I made sure that the links are well made and that the prepareforsegue method is called, but even with this code, the new view is not being loaded?

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top