GKSKNodeComponent not properly initialized from scene archive

Originator:kevin
Number:rdar://29090722 Date Originated:11/3/2016
Status:Open Resolved:
Product:iOS SDK Product Version:10.1
Classification:Serious Bug Reproducible:Always
 
When loading a scene archive using the new GKScene loader for automatic entities/components initialization, the GKSKNodeComponent is not properly initialized when another archive-defined Component tries to reference it during its didAddToEntity() call.

Reproduction Steps:
1. Open the sample project (A game template project with a simple GKComponent added with a didAddToEntity() implementation that references the GKSKNodeComponent's node and adds the project template's Pulse action to run continuously during its didAddToEntity() implementation, with that component then added to the GameScene.sks archive for the helloWorld label)
2. Run it, see the crash

Expected:
The "Hello World" label continuously pulses.

Actual:
The application crashes. GKSKNodeComponent does not have a reference to it's associated node, though it shouldn't have been able to be initialized or added to the entity without it.

Notes:
Workaround is to track for the first update(:) call when the need exists for node-based initialization, but that adds expensive checking logic in to every game loop.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!