• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: debugging AutoLayout exception with no build errors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: debugging AutoLayout exception with no build errors


  • Subject: Re: debugging AutoLayout exception with no build errors
  • From: 2551 <email@hidden>
  • Date: Thu, 05 Nov 2015 21:50:19 +0700

> On 5 Nov 2015, at 20:33, Ken Thomases <email@hidden> wrote:

> It's trying to log the problem, but getting an exception while composing a description string for one of the constraints.


Ahh, right. That’s what the ‘Unable to create description’ bit means. Thanks.

> You've truncated the stack trace

Full stack trace appended below from when the [showWindow] message is sent.


>  Could it be that the window has a minimum or maximum size that's conflicting with the size the view wants to be?

There’s a minimum size set that’s much smaller than the View size. There’s no maximum size set for the Window.

In fact, this problem only started to occur because in the last update to the app I changed a previously fixed-sized window to be resizable. After release, I realised I’d carelessly overlooked setting constraints on one of the textViews in a 3-tab tabview so that one of them didn't scale with the window (call me a luddite, but I still yearn for the old days of springs and struts; never had so much trouble with layout since AutoLayout…;p ).

I’ve been assuming its that tabView that’s causing the problem, but even removing all those constraints doesn’t avoid the issue.


> You could break on the exception

Bear with me. My debugging-foo doesn’t extend much beyond logging and a few basic exceptions, but I don’t think this is possible for the simple reason no exception is raised on my build machine. I have some vague notion that I can attach the Clang debugger in Terminal to a running process, maybe on my 10.9 machine— is that possible? A Complete Idiot’s Guide (or link to…) would be welcome here, if so.

> or set a breakpoint on -[NSView(NSConstraintBasedLayout) engine:willBreakConstraint:dueToMutuallyExclusiveConstraints:].

Not sure I’m still following along. Are we talking symbolic breakpoint here? I tried that, but the app just builds and runs fine on 10.11.


> Either way, select that frame of the stack.  Then, try to examine the third parameter, which seems like it would be the array of constraints.


Ken, this is beyond my ken. Sure, I know what frames and stacks are, but I don’t understand where/how/when I’m supposed to be selecting these frames and stacks in the debugger when no debug session appears in Xcode. Or are you suggesting I export the project to my 10.9 install and run it from Xcode there? In theory I could do that (I think there’s an old Xcode install on that machine), but I’m not sure if the project will build if it was made in 10.11, will it?

Hmm…I know I could just revert back to the last commit before I made these changes and start all over again testing step by step, but there’s a lot of other work in here I don’t really want to recapitulate if i can avoid it.

Appreciate any further thoughts! Here’s that full stack trace:


	0   CoreFoundation                      0x00007fff9497025c __exceptionPreprocess + 172
	1   libobjc.A.dylib                     0x00007fff92de3e75 objc_exception_throw + 43
	2   CoreFoundation                      0x00007fff9497010c +[NSException raise:format:] + 204
	3   Foundation                          0x00007fff8f98cc55 descriptionForLayoutAttribute_layoutItem_coefficient + 145
	4   Foundation                          0x00007fff8f98caaf -[NSLayoutConstraint equationDescription] + 215
	5   Foundation                          0x00007fff8f98cf3e -[NSLayoutConstraint description] + 298
	6   CoreFoundation                      0x00007fff949620e1 -[NSArray descriptionWithLocale:indent:] + 481
	7   Foundation                          0x00007fff8f7517bb _NSDescriptionWithLocaleFunc + 64
	8   CoreFoundation                      0x00007fff9485ece4 __CFStringAppendFormatCore + 7332
	9   CoreFoundation                      0x00007fff9488d263 _CFStringCreateWithFormatAndArgumentsAux + 115
	10  CoreFoundation                      0x00007fff948c4aeb _CFLogvEx + 123
	11  Foundation                          0x00007fff8f77b32c NSLogv + 79
	12  Foundation                          0x00007fff8f77b2b8 NSLog + 148
	13  AppKit                              0x00007fff8f1dc194 -[NSView(NSConstraintBasedLayout) engine:willBreakConstraint:dueToMutuallyExclusiveConstraints:] + 114
	14  Foundation                          0x00007fff8f98713e -[NSISEngine handleUnsatisfiableRowWithHead:body:usingInfeasibilityHandlingBehavior:mutuallyExclusiveConstraints:] + 507
	15  Foundation                          0x00007fff8f98789c -[NSISEngine tryUsingArtificialVariableToAddConstraintWithMarker:rowBody:usingInfeasibilityHandlingBehavior:mutuallyExclusiveConstraints:] + 379
	16  Foundation                          0x00007fff8f784e89 -[NSISEngine tryToAddConstraintWithMarker:expression:integralizationAdjustment:mutuallyExclusiveConstraints:] + 663
	17  Foundation                          0x00007fff8f98d897 -[NSLayoutConstraint _addLoweredExpression:toEngine:integralizationAdjustment:lastLoweredConstantWasRounded:mutuallyExclusiveConstraints:] + 285
	18  Foundation                          0x00007fff8f7792cf -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] + 204
	19  AppKit                              0x00007fff8e97520b __52-[NSView(NSConstraintBasedLayout) _setLayoutEngine:]_block_invoke_2 + 411
	20  Foundation                          0x00007fff8f7873aa -[NSISEngine withBehaviors:performModifications:] + 119
	21  AppKit                              0x00007fff8e8d795c -[NSView(NSConstraintBasedLayout) _withAutomaticEngineOptimizationDisabled:] + 66
	22  AppKit                              0x00007fff8e975049 __52-[NSView(NSConstraintBasedLayout) _setLayoutEngine:]_block_invoke + 433
	23  AppKit                              0x00007fff8e8da4fa -[NSView(NSConstraintBasedLayout) _setLayoutEngine:] + 229
	24  AppKit                              0x00007fff8e975122 __52-[NSView(NSConstraintBasedLayout) _setLayoutEngine:]_block_invoke_2 + 178
	25  Foundation                          0x00007fff8f7873aa -[NSISEngine withBehaviors:performModifications:] + 119
	26  AppKit                              0x00007fff8e8d795c -[NSView(NSConstraintBasedLayout) _withAutomaticEngineOptimizationDisabled:] + 66
	27  AppKit                              0x00007fff8e975049 __52-[NSView(NSConstraintBasedLayout) _setLayoutEngine:]_block_invoke + 433
	28  AppKit                              0x00007fff8e8da4fa -[NSView(NSConstraintBasedLayout) _setLayoutEngine:] + 229
	29  AppKit                              0x00007fff8e97ab9e make_and_host_engine + 256
	30  AppKit                              0x00007fff8e97a8e7 -[NSView(NSConstraintBasedLayout) _didChangeHostsAutolayoutEngineTo:] + 165
	31  AppKit                              0x00007fff8e91ccce -[NSView(NSConstraintBasedLayout) _engageAutolayout] + 81
	32  AppKit                              0x00007fff8e91cceb -[NSView(NSConstraintBasedLayout) _engageAutolayout] + 110
	33  AppKit                              0x00007fff8e8e240a -[NSView(NSConstraintBasedLayout) _layoutEngine_windowDidChange] + 87
	34  AppKit                              0x00007fff8f01c8ee __21-[NSView _setWindow:]_block_invoke643 + 67
	35  AppKit                              0x00007fff8e8d8b6a -[NSView _setWindow:] + 1325
	36  AppKit                              0x00007fff8e8d67d4 -[NSView addSubview:] + 364
	37  AppKit                              0x00007fff8e8ea933 -[NSFrameView addSubview:] + 45
	38  AppKit                              0x00007fff8e8f8c65 -[NSWindow setContentView:] + 511
	39  AppKit                              0x00007fff8e8db50b -[NSWindowTemplate nibInstantiate] + 855
	40  AppKit                              0x00007fff8e8b1520 -[NSIBObjectData instantiateObject:] + 309
	41  AppKit                              0x00007fff8e8b0815 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 413
	42  AppKit                              0x00007fff8e8a55ce loadNib + 327
	43  AppKit                              0x00007fff8e8a4b6c +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 288
	44  AppKit                              0x00007fff8eb394d2 +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 140
	45  AppKit                              0x00007fff8eb392ca -[NSWindowController loadWindow] + 196
	46  AppKit                              0x00007fff8eb3df88 -[NSWindowController window] + 80
	47  AppKit                              0x00007fff8eb3f0f0 -[NSWindowController showWindow:] + 36





_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: debugging AutoLayout exception with no build errors
      • From: Conrad Shultz <email@hidden>
References: 
 >debugging AutoLayout exception with no build errors (From: 2551 <email@hidden>)
 >Re: debugging AutoLayout exception with no build errors (From: Ken Thomases <email@hidden>)

  • Prev by Date: How to run Spotlight Index Extension (iOS)?
  • Next by Date: Re: debugging AutoLayout exception with no build errors
  • Previous by thread: Re: debugging AutoLayout exception with no build errors
  • Next by thread: Re: debugging AutoLayout exception with no build errors
  • Index(es):
    • Date
    • Thread