CNContactViewController - "UIColor created with component values far outside the expected range. "

63 views Asked by At

iOS 17 (Xcode 15)

When I display the a contact using the UI framework, I get this in the console:

UIColor created with component values far outside the expected range. Set a breakpoint on UIColorBreakForOutOfRangeColorComponents to debug. This message will only be logged once.

      let contact = CNContact()
      let cnVC = CNContactViewController(forUnknownContact: contact)
      present(cnVC, animated: true)

How do I do "Set a breakpoint on UIColorBreakForOutOfRangeColorComponents", when I don't have custom code for this? I think the color problem is inside the ContactsUI framework.

UPDATE: I set the symbolic breakpoint, and ran it again and I see:

UIKitCore`UIColorBreakForOutOfRangeColorComponents:
->  0x103885104 <+0>:   sub    sp, sp, #0x40
    0x103885108 <+4>:   stp    x29, x30, [sp, #0x30]
    0x10388510c <+8>:   add    x29, sp, #0x30
    0x103885110 <+12>:  adrp   x8, 4606
    0x103885114 <+16>:  ldr    x8, [x8, #0xaf8]
    0x103885118 <+20>:  str    x8, [sp, #0x8]
    0x10388511c <+24>:  adrp   x8, 2957
    0x103885120 <+28>:  ldr    d0, [x8, #0x2d8]
    0x103885124 <+32>:  str    d0, [sp, #0x10]
    0x103885128 <+36>:  adrp   x8, 0
    0x10388512c <+40>:  add    x8, x8, #0x178            ; __UIColorBreakForOutOfRangeColorComponents_block_invoke
    0x103885130 <+44>:  adrp   x9, 4619
    0x103885134 <+48>:  add    x9, x9, #0x5f0            ; __block_descriptor_40_e5_v8?0l
    0x103885138 <+52>:  stp    x8, x9, [sp, #0x18]
    0x10388513c <+56>:  adrp   x8, 3061
    0x103885140 <+60>:  add    x8, x8, #0x1ef            ; "UIColorBreakForOutOfRangeColorComponents"
    0x103885144 <+64>:  str    x8, [sp, #0x28]
    0x103885148 <+68>:  adrp   x8, 5726
    0x10388514c <+72>:  ldr    x8, [x8, #0xc00]
    0x103885150 <+76>:  cmn    x8, #0x1
    0x103885154 <+80>:  b.ne   0x103885164               ; <+96>
    0x103885158 <+84>:  ldp    x29, x30, [sp, #0x30]
    0x10388515c <+88>:  add    sp, sp, #0x40
    0x103885160 <+92>:  ret    
    0x103885164 <+96>:  adrp   x0, 5726
    0x103885168 <+100>: add    x0, x0, #0xc00            ; UIColorBreakForOutOfRangeColorComponents.once
    0x10388516c <+104>: add    x1, sp, #0x8
    0x103885170 <+108>: bl     0x1042cc8f4               ; symbol stub for: dispatch_once
    0x103885174 <+112>: b      0x103885158               ; <+84>
0

There are 0 answers