Moin!
Ich bin gerade dabei, Konsol-Meldungen meiner App zu reduzieren ... einiges "fliegt" bzgl. Layout-Constraints durch. Um so erstaunter war ich, dass sich diese bei Anzeigen von UIAlertController auftreten ... Ich habe dann mal ein Beispiel-Projekt erzeugt, das nur per folgendem Code einen UIAlertController anzeigt (Single-View, ein Button, eine Methode):
Alles anzeigen
Und prompt quittiert dies die Konsole mit:
Mattes
Ich bin gerade dabei, Konsol-Meldungen meiner App zu reduzieren ... einiges "fliegt" bzgl. Layout-Constraints durch. Um so erstaunter war ich, dass sich diese bei Anzeigen von UIAlertController auftreten ... Ich habe dann mal ein Beispiel-Projekt erzeugt, das nur per folgendem Code einen UIAlertController anzeigt (Single-View, ein Button, eine Methode):
Quellcode
- - (IBAction)showAlert:(id)sender
- {
- UIAlertController *warningAlertController = [UIAlertController alertControllerWithTitle:nil
- message:@"Message" preferredStyle:UIAlertControllerStyleActionSheet];
- [warningAlertController addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * action)
- {
- [warningAlertController dismissViewControllerAnimated:YES completion:nil];
- }]];
- [warningAlertController addAction:[UIAlertAction actionWithTitle:@"Okay" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * action)
- {
- [warningAlertController dismissViewControllerAnimated:YES completion:nil];
- }]];
- warningAlertController.popoverPresentationController.sourceView = self.view;
- [self presentViewController:warningAlertController animated:YES completion:nil];
- }
Was verpasse ich ... oder ist es ein Bug seitens Apple (was ich ehrlich gesagt vermute)?2020-06-08 08:43:21.587930+0200 Test[15949:18791732] [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:0x60000160f4d0 UIView:0x7ff77df18c60.width == - 16 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60000160f4d0 UIView:0x7ff77df18c60.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.
Mattes
Diese Seite bleibt aus technischen Gründen unbedruckt.