i have the following code to present an alert with different messages when problems occur in my app. the code has worked fine for years, and is in most of my applications on the App Store.
i am making a new app, and simply added this code in, however i am seeing the error messages below in the console, which i can not get rid of.
the constraint message refers to the alert width, but i have no constraints set , and no means to adjust any to silence the warning.
can somebody please advise what's going wrong.
thanks
-(void)errorMessage:(id)sender
{
UIAlertController *alert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Information",)
message:displaymessage
preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *firstAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK",)
style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
[self dismissViewControllerAnimated:NO completion:nil];
}];
[alert addAction:firstAction];
[self presentViewController:alert animated:YES completion:nil];
}
2019-04-18 09:17:54.785207+0100 TestInputView5[1380:28232] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x600001e15b30 UIView:0x7fe60c6104e0.width == - 16 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600001e15b30 UIView:0x7fe60c6104e0.width == - 16 (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.