Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 287 Vote(s) - 3.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New auto layout errors with Xcode 8.1

#1
I have a macOS app that was running just fine until I upgraded to Xcode 8.1.

The app opens a dialogue with `NSOpenPanel` to allow the user to choose an image. When I select an image and choose "Open" I get the following error:

> 2016-11-03 10:23:25.589283 PA Places Data[9008:265214] [Layout]
> Detected missing constraints for NSTextField: 0x6000001e3a00. It
> cannot be placed because there are not enough constraints to fully
> define the size and origin. Add the missing constraints or set
> translatesAutoresizingMaskIntoConstraints=YES and constraints will be
> generated for you. If this view is laid out manually on macOS 10.12
> and later, you may choose to not call [super layout] from your
> override. Set a breakpoint on DETECTED_MISSING_CONSTRAINTS to debug.
> This error will only be logged once.

The open dialogue then freezes and cannot be dismissed.

As suggested, I set a breakpoint for `DETECTED_MISSING_CONSTRAINTS` and find that execution is halting on `myPopup.runModal()` in this code:

func happyAlert(message: String, info: String) {
let myPopup: NSAlert = NSAlert()
myPopup.messageText = message
myPopup.informativeText = info
myPopup.alertStyle = NSAlertStyle.informational
myPopup.addButton(withTitle: "OK")
myPopup.runModal()
}

This alert informs the user that the image has passed or not passed various validation checks.

What used to happen is that the image was selected, the `NSOpenPanel` dismissed and the alert appeared without any problems.

Now I get the error about constraints for an NSTextField, but I don't understand why they would be involved here, especially since Xcode does not flag any autolayout issues with the underlying view.

Can anyone explain what might be going on and/or a strategy for further debugging? My experience is limited and I am baffled.
Reply

#2
Check your view hierarchy in the interface builder it might be that the textField sits on top of everything and Xcode is trying to set the constraints for it. Otherwise, perhaps add some screenshots of what is going on in your storyboards.
Have you tried setting the textField's in question width and height from = to >= the value set? I had issues in the past where such a silly setting has sorted a bug similar to this one.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through