This is rather odd and I don’t yet know how to debug it.
In a method, I have this line:
SelectObjects UndoNext.Value("Selection"),True //UndoNext is a dictionary
The SelectObjects method looks like this:
Sub SelectObjects(Objects() As Object2D,Only As Boolean) if Only then DeselectAll //A method which deselects the currently selected items for each o2d as Object2D in Objects AddObjectToSelection o2d next End Sub
By putting a breakpoint at the “for each” line, the debugger tells me “Objects” contains 3 items, which is as expected. Then, I hit “Step over” and “Objects” changes to an empty array. If this was earlier (e.g. at the “DeselectAll” statement), I’d conclude the DeselectAll method can be the culprit, but no, it happens after the “for” statement.
If I check the content of “Objects” in the IDE, even before the first line of SelectObjects is executed, my app crashes (EXC_BAD_ACCESS).
I’m writing this post because of the crash and the fact that the variable changing at a “for” statement doesn’t sound logical to me.
Or perhaps I’m missing something?