As mentioned in a first comment you shouldn't determine a segue in prepareForSegue
because it already determined there.
You can create an IBAction
for your nextButton and determine segue in it
- (IBAction)nextButtonTapped:(id)sender
{
if (self.itemSearch.text.length > 0) {
[PFCloud callFunctionInBackground:@"eBayCategorySearch"
withParameters:@{@"item": self.itemSearch.text}
block:^(NSString *result, NSError *error) {
if (!error) {
NSLog(@"The result is '%@'", result);
if ([result intValue] == 1) {
[self performSegueWithIdentifier:@"ShowMatchCenterSegue" sender:self];
} else {
[self performSegueWithIdentifier:@"ShowCriteriaSegue" sender:self];
}
}
}];
}
}
Now you should connect your next button with this action and set identifiers for your segues in IB.
Also you can use prepareForSegue
to transfer data between you view controllers
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"ShowMatchCenterSegue"]) {
MYMatchCenterViewController *matchCenterViewController = [segue destinationViewController];
matchCenterViewController.data = self.someData;
} else {
...
}
}