Search code examples
objective-cgameplay-kit

EXC_BAD_ACCESS when reasigning GKGridGraph


I have a graph like this:

@property (nonatomic, strong) GKGridGraph *graph;

Assgin it with width and height:

 self.graph = [[GKGridGraph alloc] initFromGridStartingAt:(vector_int2){0, 0}
                                                    width:38
                                                   height:8
                                         diagonalsAllowed:NO];

And later I need to reasign self.graph with new width and height, so I do the same as above. And by doing so I get EXC_BAD_ACCESS.

I tried creating new graph and assigning it to self.graph and still get the same.


Solution

  • I had the same problem using swift and 9.2 as the target. I reverted to 9.0 as the target and the problem went away. So I'm guessing that it is a bug.