1

My app dose not crashes but the UI is broken. I am getting this error

*UILabel:0x137d4d060- AMBIGUOUS LAYOUT for UILabel:0x137d4d060.minX{id: 3323}, UILabel:0x137d4d060.minY{id: 3334}

I found in the forum this similar question but printing the description of the Label dose not help me to locate it. How can I identify the label 0x137d4d060 causing the problem?

user567
  • 3,712
  • 9
  • 47
  • 80
  • what do you mean by _identify_? you can use [Xcode Debugging Tools](https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/debugging_with_xcode/chapters/debugging_tools.html) anytime, I presume. – holex Feb 05 '18 at 16:41
  • By identify I mean figure out which label is causing the problem. For example convert this hex value to a label name... – user567 Feb 05 '18 at 16:42
  • 3
    You can do `po [(UILabel *)0x137d4d060 setBackgroundColor:[UIColor redColor]]`. Also doing `po 0x137d4d060 ` should print something like ">" and you have the "text", which could help you find it. Also debug hierarchy could help you find the label with that particular frame too. – Larme Feb 05 '18 at 16:43
  • can you not find in something the _Xcode Debugging Tools_ or what your issue is, precisely? I don't understand the problem here at all... – holex Feb 05 '18 at 16:44
  • You can use label identifier from attributes inspector. Set your affected screen's labels identifier, which are display with label id when your ui brakes. – Sagar Chauhan Feb 05 '18 at 17:43
  • 1
    Rather than trying to find it by hex value, I'd go to the view debugger. These warnings show up under "runtime" errors in the "Issues navigator". You can then click on the error there and it will take you to the offending view. – Rob Mar 28 '18 at 19:20

0 Answers0