UIAlertController liefert LayoutConstraint-Fehler

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • UIAlertController liefert LayoutConstraint-Fehler

    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):

    Quellcode

    1. - (IBAction)showAlert:(id)sender
    2. {
    3. UIAlertController *warningAlertController = [UIAlertController alertControllerWithTitle:nil
    4. message:@"Message" preferredStyle:UIAlertControllerStyleActionSheet];
    5. [warningAlertController addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * action)
    6. {
    7. [warningAlertController dismissViewControllerAnimated:YES completion:nil];
    8. }]];
    9. [warningAlertController addAction:[UIAlertAction actionWithTitle:@"Okay" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * action)
    10. {
    11. [warningAlertController dismissViewControllerAnimated:YES completion:nil];
    12. }]];
    13. warningAlertController.popoverPresentationController.sourceView = self.view;
    14. [self presentViewController:warningAlertController animated:YES completion:nil];
    15. }
    Alles anzeigen
    Und prompt quittiert dies die Konsole mit:
    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.
    Was verpasse ich ... oder ist es ein Bug seitens Apple (was ich ehrlich gesagt vermute)?

    Mattes
    Diese Seite bleibt aus technischen Gründen unbedruckt.
  • Mir ist auch nicht klar, warum Apple überhaupt die Meldung von Fehlern ermöglicht, wenn sich eh keiner bei Apple dafür interessiert. :(

    Wenn iOS, macOS usw. Hobby oder Open Source Projekte wären, dann könnte man Fehler ja noch verstehen, bei einer Billion Dollar Company finde ich die vielen Bugs gehen gar nicht.

    Ich traue mich aktuell nicht mehr die neue Version von Safari und das Security Update für macOS 10.14 zu installieren, da nach den letzten Updates (Safari und Security Update) Apple Mail keine Mails mehr angezeigt hat und Safari 13.1 keine Webseiten mehr öffnet und in einer Endlosschleife mit Fehlermeldung hängen bleibt. :( Aktuell muss ich daher die Safari Technology Preview verwenden.

    Mir ist bekannt, dass macOS 10.15 das aktuelle macOS ist und nicht 10.14, aber dann sollte Apple lieber keine Updates mehr für macOS 10.14 anbieten, wenn diese nicht funktionieren und das System teilweise unbrauchbar machen.