This may be very rookie but...
I've set a segue between two ViewControllers
in my Storyboard
, with the identifier clickBtn
.
Now I'm calling it this way in my code:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"clickBtn"])
{
if(conditionVerified)
{
SecondViewController *controller = (SecondViewController *)segue.destinationViewController;
[controller setManagedObjectContext:self.managedObjectContext];
}
else
{
// If I enter here I get the error below
}
}
}
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+entityForName: nil is not a legal NSManagedObjectContext parameter searching for entity name 'Link''
In fact I don't want to do this transition if I enter the else-statement. How to do so?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…