I'm looking through my crash reports in TestFlight and the most frequent crash is:
Cannot remove an observer "ListViewController 0x1d590500" for the key path "batchImageDownloadingInProgress" from "ListArchiver 0x1d5b83b0" because it is not registered as an observer.
In ListViewController:
- (void)viewWillAppear:(BOOL)animated
{
...
[[WanderlistArchiver sharedArchiver] addObserver:self forKeyPath:@"batchImageDownloadingInProgress" options:NSKeyValueObservingOptionNew context:nil];
}
// **** the error happens in here ****
- (void)viewWillDisappear:(BOOL)animated
{
...
[[WanderlistArchiver sharedArchiver] removeObserver:self forKeyPath:@"batchImageDownloadingInProgress"];
}
If I set up the observer in viewWillAppear (and don't touch it anywhere else in the code), why is it not still registered when viewWillDisappear runs? This has only happened 5 times in the last 90 days, but I'd still like to understand why this is happening.