I want to prompt the user to save changes before they navigate back out of editing an entity in my IOS7 application.
An early stack overflow said I can detect this will happen at this point here: but I've been unable to abort the navigation.
-(void)willMoveToParentViewController:(UIViewController *)parent {
NSLog(@"\t\t\tThis VC has has been pushed popped OR covered");
if (!parent) {
NSLog(@"\t\t\tThis happens ONLY when it's popped");
}
}
basically if my managedObjectContext
has unsaved changes I'd like to pop an alert box before the back navigation event happens. Any ideas?
I tried this solution: https://stackoverflow.com/a/19210888/2069812 but doesn't seem to work.