Apple ARKit by Example
Mark Dawson

Hi Mark,

Thanks for the great tutorial and sharing the code. I’m trying to run the code with PBR, but with XCode Version 9.0 beta 3 (9M174d) and latest beta iOS 11.0 (15A5327g) I’m experiencing a crash when trying to change the material of the objects.

Specifically hitTest result returns a node that resolves as neither a Cube or a Plane . This is the piece of code where the app crashes:

SCNNode *parentNode = node.parentNode;
if ([parentNode isKindOfClass:[Cube class]]) {
    [((Cube *)parentNode) changeMaterial];
} else {
    [((Plane *)parentNode) changeMaterial];

Any idea why this might be? I’m digging deeper but I thought I would ask as the expert in case you encountered something similar.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.