"This NSLayoutConstraint is being configured with a constant that exceeds internal limits"

10,940

Omit the () from the symbol name. It's a little clearer what is happening if you use the debugger console window to set this breakpoint with the breakpoint set --name command:

(lldb) br s -n _NSLayoutConstraintNumberExceedsLimit()
Breakpoint 1: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) br s -n _NSLayoutConstraintNumberExceedsLimit
Breakpoint 2: where = Foundation`_NSLayoutConstraintNumberExceedsLimit, address = 0x00007fff9168e6f5
(lldb) 

If you had used the breakpoint list (br l) command in your Xcode debug session, you would have seen that the _NSLayoutConstraintNumberExceedsLimit() breakpoint didn't get set in any locations.

Share:
10,940

Related videos on Youtube

Robert Atkins
Author by

Robert Atkins

Updated on June 03, 2022

Comments

  • Robert Atkins
    Robert Atkins about 2 years

    While trying to debug an AutoLayout problem (a table cell which should be growing according to the size of its content isn't, in some circumstances), I set a breakpoint on the last line of my tableView:heightForRow: method, and trying to print the value of systemLayoutSizeFittingSize: I get this:

    (lldb) p ((CGSize)[cachedCell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize]).height
    2014-10-14 11:15:49.492 AppName[72132:10302054] This NSLayoutConstraint is being configured with a constant that exceeds internal limits.  A smaller value will be substituted, but this problem should be fixed. Break on void _NSLayoutConstraintNumberExceedsLimit() to debug.  This will be logged only once.  This may break in the future.
    (CGFloat) $0 = 57
    

    Well ok, that's interesting. But I try and do what it says and set a breakpoint on that function:

    Grab of breakpoint definition on _NSLayoutConstraintNumberExceedsLimit()

    ... and this breakpoint doesn't get hit.

    • Am I setting the breakpoint correctly?
    • In any case, any clues on what might be wrong with my constraints to lead to this?

    (Annoyingly, it seems to work in some cases but not in others and I can't see a difference in the setup.)

  • Robert Atkins
    Robert Atkins over 9 years
    Well, now I've got a breakpoint set according to br l (thank you!) but it still doesn't get hit—unless I call p (CGSize)[cachedCell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize] in the debugger, in which case I can see the hit count go up!
  • Robert Atkins
    Robert Atkins over 9 years
    Finally solved the problem. If I have to set preferredMaxLayoutWidth on the label manually, what the hell is Auto Layout doing for me?!
  • orkenstein
    orkenstein over 9 years
    @RobertAtkins, how did you fix it?
  • Robert Atkins
    Robert Atkins over 9 years
    I had a label horizontally adjacent to a UIImageView in my cell. In order for the label to correctly calculate the height it wanted, I had to set its preferredMaxLayoutWidth to the width of the cell, minus the width of the UIImageView and any adjacent padding. That I had to do this at all I find kind of stupid, and it seems it's no longer necessary on iOS 8.
  • orkenstein
    orkenstein over 9 years
    @RobertAtkins, looks really stupid. What in case of different cell width?
  • Robert Atkins
    Robert Atkins over 9 years
    I think I subtracted the UIView & padding from the cell's contentView.frame.width? Don't have that code to hand right now.
  • Dani
    Dani over 4 years
    What is "0x00007fff9168e6f5"?
  • John Stephen
    John Stephen almost 3 years
    @DanielSpringer 0x00007fff9168e6f5 is the memory address of the function _NSLayoutConstraintNumberExceedsLimit, but it can/will change each run so you have to use the symbol _NSLayoutConstraintNumberExceedsLimit.