In my code I have this line, but I was wondering if there is way to check whether @\"SomeController\" exists before I use it with the \"instantiateViewControllerWit
As Tom said, the best solution to this problem is the try-catch block:
@try {
UIViewController *newViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"identifier"];
}
@catch (NSException *exception) {
UIAlertView *catchView;
catchView = [[UIAlertView alloc]
initWithTitle: NSLocalizedString(@"Error", @"Error")
message: NSLocalizedString(@"Identifier not found on SB".", @"Error")
delegate: self
cancelButtonTitle: NSLocalizedString(@"OK", @"Error") otherButtonTitles: nil];
[catchView show];
}
I hope it helps! even though the answer is really late.