3

I'm debugging a crash that I believe is auto layout related. When the crash occurs, I get an enormous dump of information on the output area that begins like this:

2015-06-04 13:23:44.158 SpeedySend[22084:861374] Objective: {objective 0x7f99e06b3730: <500:242.5, 250:18443.5> + <500:1>*0x7f99e061e570.negError{id: 4899} + <500:1>*0x7f99e061e570.posErrorMarker{id: 4898} + <500:1, 250:-1>*0x7f99e061f940.negError{id: 4913} + <500:1, 250:1>*0x7f99e061f940.posErrorMarker{id: 4912} + <500:1, 250:-1>*0x7f99e061fb40.negError{id: 4915} + <500:1, 250:1>*0x7f99e061fb40.posErrorMarker{id: 4914} + <500:1, 250:-2>*0x7f99e0620890.negError{id: 4807} + <500:1, 250:2>*0x7f99e0620890.posErrorMarker{id: 4806} + <500:2>*0x7f99e06496f0.posErrorMarker{id: 4916} + <500:2>*0x7f99e0649f40.posErrorMarker{id: 4920} + <50 ...

and then runs on for a very long time and ends like this:

... 250:-1>*0x7f99e1d77ec0.negError{id: 5023} + <800:1, 250:1>*0x7f99e1d77ec0.posErrorMarker{id: 5022} + <500:1, 250:-1>*0x7f99e1d78150.negError{id: 5025} + <500:1, 250:1>*0x7f99e1d78150.posErrorMarker{id: 5024} + <500:1>*0x7f99e1d78310.negError{id: 5027} + <500:1>*0x7f99e1d78310.posErrorMarker{id: 5026} + <500:1>*0x7f99e1d78620.negError{id: 5045} + <500:1>*0x7f99e1d78620.posErrorMarker{id: 5044} + <500:1>*0x7f99e1d788c0.negError{id: 5031} + <500:1>*0x7f99e1d788c0.posErrorMarker{id: 5030} + <500:1>*0x7f99e1d78d30.negError{id: 5033} + <500:1>*0x7f99e1d78d30.posErrorMarker{id: 5032} + <500:1>*0x7f99e1d790a0.negError{id: 5035} + <500:1>*0x7f99e1d790a0.posErrorMarker{id: 5034} + <500:1>*0x7f99e1d79460.negError{id: 5037} + <500:1>*0x7f99e1d79460.posErrorMarker{id: 5036} + <500:1>*0x7f99e1d79840.negError{id: 5039} + <500:1>*0x7f99e1d79840.posErrorMarker{id: 5038} + <500:1>*0x7f99e1d79c50.negError{id: 5041} + <500:1>*0x7f99e1d79c50.posErrorMarker{id: 5040} + <500:1>*0x7f99e1d7a080.negError{id: 5043} + <500:1>*0x7f99e1d7a080.posErrorMarker{id: 5042} + <500:1>*0x7f99e1d7aa60.negError{id: 5047} + <500:1>*0x7f99e1d7aa60.posErrorMarker{id: 5046} + <500:-7.45058e-08>*0x7f99e1f7ae60.negError{id: 3600}}

I would like to understand this data better as an aid to debugging my problem.

Is there a document or a posting that I can access that explains the format and meaning of this data?

Like, for instance, what does something like <500:1,250:-1> represent?

What is a negError?

And, most importantly, can something like {id: 3600} be tied back to a specific control that auto layout is laying out for me?

I'm particularly interested in the last questions because I've read here that very small numbers, when seen in these dumps, can indicate a crash due to accumulated loss of floating point precision in the auto layout engine.

You'll note that I have such a number on the very last line of my output data. So, if I can relate {id: 3600} back to one of my controls, I hope that will put me close to the origin of the problem.

Community
  • 1
  • 1
Gallymon
  • 1,557
  • 1
  • 11
  • 21
  • Use the Cocoa Layout profiler. Record with the profiler's console visible then you can stop recording once an error occurs. In my case I got: `Auto layout internal error. Cannot find an outgoing row head for incoming head 0x7fa7da4bbfa0.negError{id: 4472} during optimization of variable with near-zero coefficient, which should never happen.` Do a search for _0x7fa7da4bbfa0_ under the Event List. This should guide you in the right direction. – ThomasHaz Jun 15 '15 at 21:13
  • Tom Haz thanks for the input. I haven't tried the Cocoa Layout Profiler but I've just looked at it and it looks like a powerful tool for this sort of thing. I solved my bug by more prosaic means but the next time one rears its little head, I'm going to whop it with the profiler (smile). Cheers and thanks! – Gallymon Jun 19 '15 at 20:26
  • Cocoa Layout profiler works only on simulator, and I was facing a problem in ios 7 (simulator not available), so had to work my way out by manually manipulating the constraints. In my case, the problem was with constraints to align centerY position of two views. – Mehul Parmar Jun 01 '16 at 08:14

0 Answers0