Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

pan17

macrumors newbie
Original poster
Jul 9, 2012
11
0
I set up a segue in a view controller say called A.
Then i want to perform this segue in another view controller called B, i did this:
Code:
A *a = [[A alloc] init];
[a performSegueWithIdentifier:@"Photos" sender:a];
Then it gives me an error says A doesn't have the corresponding segue to "Photos". But when i call this in the A view controller, then it could perform the segue without any error.
Why? Thanks
 
From the UIViewController documentation for performSegueWithIdentifier:sender:

The view controller that receives this message must have been loaded from a storyboard. If the view controller does not have an associated storyboard, perhaps because you allocated and initialized it yourself, this method throws an exception.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.