In both the FINAL project, as well as my project after following the book (with updates on page 45-ish), I put the program through its paces, and have a certain situation that I cannot recover from without restarting.
When rating a bowtie, entering an invalid value, the Alert dialog pops back up, as designed… I then decide to cancel the rating (hit cancel). At that point, regardless which bowtie I select, I can no longer update any “Wear” or “Rate” values.
Are there any suggestions how to deal with a “Cancel” action? And/or, this brings up the need to learn how to troubleshoot what is happening in “my” code that probably traces back to Core Data library code… Or is there something simple that I am missing?
It should be noted, if the user cancels a “Rate” action before entering an invalid value, the program operates as expected. Troubleshooting a second UIAlertController, with a “cancel” action has been a challenge.
THANKS!
This is the output from the console. Note: whichever bowtie was selected when the Rating action was cancelled will be referenced in this output:
Could not fetch Error Domain=NSCocoaErrorDomain Code=1620 “The operation couldn’t be completed. (Cocoa error 1620.)” UserInfo={NSValidationErrorObject=<Bow_Ties.Bowtie: 0x6180000c3cd0> (entity: Bowtie; id: 0xd000000000180000 x-coredata://0C7CB81E-8B86-428A-AEB4-B84007BCE203/Bowtie/p6 ; data: {
isFavorite = 0;
lastWorn = “2014-06-16 18:15:24 +0000”;
name = “Orange Bow Tie”;
photoData = <89504e47 0d0a1a0a 0000000d 49484452 000003e8 000003e8 08020000 00c2c143 b3000000 01735247 4200aece 1ce90000 001c>;
rating = “-1”;
searchKey = O;
timesWorn = 2;
tintColor = “UIExtendedSRGBColorSpace 1 0.627451 0.478431 1”;
}), NSValidationErrorValue=-1, NSValidationErrorKey=rating, NSLocalizedDescription=The operation couldn’t be completed. (Cocoa error 1620.)}, [AnyHashable(“NSLocalizedDescription”): The operation couldn’t be completed. (Cocoa error 1620.), AnyHashable(“NSValidationErrorValue”): -1, AnyHashable(“NSValidationErrorObject”): <Bow_Ties.Bowtie: 0x6180000c3cd0> (entity: Bowtie; id: 0xd000000000180000 x-coredata://0C7CB81E-8B86-428A-AEB4-B84007BCE203/Bowtie/p6 ; data: {
isFavorite = 0;
lastWorn = “2014-06-16 18:15:24 +0000”;
name = “Orange Bow Tie”;
photoData = <89504e47 0d0a1a0a 0000000d 49484452 000003e8 000003e8 08020000 00c2c143 b3000000 01735247 4200aece 1ce90000 001c>;
rating = “-1”;
searchKey = O;
timesWorn = 2;
tintColor = “UIExtendedSRGBColorSpace 1 0.627451 0.478431 1”;
}), AnyHashable(“NSValidationErrorKey”): rating]