NSArray content not showing in debugger variable watchlist in Xcode 6.1

Finding a weird issue while debugging some code in Xcode 6.1 where the NSArray value I'm debugging has objects, but the debugger doesn't show anything when inspecting individual items. This is what I see in the debugger ...

enter image description here

The kPatternDiculticulties array is populated with the following line of code ...

NSArray *kPatternDifficulties = [self.definition objectForKey:@"pattern-difficulties"];

      

Usually when I see something like this, I find a big cursory check to see if optimization is enabled for a particular schema / configuration. In this case, disabling the optimization did nothing. As a next step I figured it might be a memory issue, maybe the content of self.definition is auto-implemented ahead of time, so I tried to switch the above line to copy instead of assignemnt ...

NSArray *kPatternDifficulties = [NSArray arrayWithArray:[self.definition objectForKey:@"pattern-difficulties"]];

      

And it works. I can see all the elements of the NSArray correctly, so I have a solution that is great. I have some questions like ...

  • This only crashes on iOS8 devices. Previous versions of iOS seem to be failing, was there something notable about memory management changed in iOS8 that could be causing this?
  • What would be the general agreement / standard around such a case? Is it okay to assign to a variable or would a copy be more correct? I am reading NSArray from self.definition, which is saved by the object itself, so I don't think it should be released anyway until the object is released, and yet there is a problem with accessing that memory as is.
+3


source to share





All Articles