8

I am a little confused by something I am seeing in Xcode 7, the 3 colors below all have a separate address as you would expect, but the weak colors all have the same address. I understand that the weak colors are optionals so weak_R and color_R have different addresses, but I can't quite work out why all 3 weaks display the same address.

Does this seem right, and if it is can someone explain what I am seeing? If not I am guessing its a bug.

CODE

    var color_R = SKColor.redColor()
    var color_G = SKColor.greenColor()
    var color_B = SKColor.blueColor()
    weak var weak_R = color_R
    weak var weak_G = color_G
    weak var weak_B = color_B

DEBUG

enter image description here

fuzzygoat
  • 26,573
  • 48
  • 165
  • 294
  • 8
    I think it's an XCode bug: typing `p weak_R` at the lldb prompt will print a less surprising address. – Mario Zannone Aug 21 '15 at 16:39
  • 1
    File a [bug report](http://bugreport.apple.com). – zaph Aug 21 '15 at 17:01
  • 2
    Much appreciated, for a minute I was thinking that I was missing something fundamental :) your suggestion of p weak_R, p weak_G do indeed print different addresses, i had been trying po rather than p. So it is indeed a bug (at least as far as the UI goes) Thanks again for confirming Sir. – fuzzygoat Aug 21 '15 at 17:05

0 Answers0