0

This question is very similar to Xcode debugger reporting Swift dictionaries as empty (po reports {}) but differs in that I'm not relying on the "po" command, but rather on the default display of the debugger. Also, I'm experiencing this on both the iPad 2 simulator and on an iPad mini 1st gen device.

Using Swift with Xcode 6.3.2.

As you can see, calling count on the dictionary (called "simultaneousSoundPlayers") returns 1 (which I believe to be correct at this point, since at this point an NSLog command also displays a count of 1).

But the debugger's inspection of the dictionary itself (either by standalone name or expanding the parent object, self) makes the dictionary appear to have no key/value pairs.

Any idea why this happens? Is it just debugger quirkiness?

enter image description here

Community
  • 1
  • 1
Ben Wheeler
  • 6,788
  • 2
  • 45
  • 55
  • "Is it just debugger quirkiness" It certainly could be (heaven knows it is quirky), but since we can't see where you have paused in your code, it could also be that you are just checking the value too early. – matt Jun 08 '15 at 19:02
  • I could add a screenshot of that, but no matter where i'm paused, don't you agree that the number of dictionary pairs appears to be both 0 and 1? that would never actually be true, right? – Ben Wheeler Jun 08 '15 at 20:48
  • and in fact, even much later, when my code is happily accessing entries in the self.simultaneousSoundPlayers dictionary, the debugger STILL says 0 key/value pairs. it's just wrong, no matter where i pause. – Ben Wheeler Jun 08 '15 at 20:50
  • I'm totally with you but I don't see what your question is. It's more of a moan, really. The debugger is quirky. Well, we knew _that_. :) – matt Jun 08 '15 at 21:08

0 Answers0