NSCFTimer supportsContentDimensionVariables crash-Collection of common programming errors
I’m getting an odd crash using a modal UIViewController that is managing a Zbar scanner.
I’m displaying it:
UIViewController *viewController = [[self scannerManager] instantiateScannerViewController];
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
[self presentViewController:viewController animated:YES completion:NULL];
Then dismissing it:
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];
[self dismissViewControllerAnimated:YES completion:NULL];
The crash sometimes is :
* Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[__NSCFTimer _supportsContentDimensionVariables]: unrecognized selector sent to instance 0xb2e3b40’
The crash sometimes is:
* Terminating app due to uncaught exception ‘NSGenericException’, reason: ‘Unable to install constraint on view. Does the constraint reference something from outside the subtree of the view? That’s illegal.
> constraint: h=--- v=--- UIView:0xb4257f0.midX == UITransitionView:0x1521ce50.midX>
> view: clipsToBounds = YES; autoresize = H; layer = >'
In tracking this down, it’s definitely related to an auto-layout message I get on the presenting UIViewController:
All dependent constraints should have been removed from the engine and also from the view’s list of dependent constraints