I encountered this error in my application and i found out that if you have a property declaration, try not to use the weak setter attribute, instead you can use retain if your value changes over time. That made my application work for iOS 7/8 on x64 devices and the normal devices. Hope it helps.
'Attemped to add nil node', reason: 'Attemped to add nil node to parent: <SKScene> name:'(null)'
-
10-10-2022 - |
Question
I have these 3 lines of code:
self.tapToFlyLabel = [SKSpriteNode spriteNodeWithImageNamed:@"tap_to_fly"];
self.tapToFlyLabel.position = CGPointMake(self.size.width/2, self.scene.size.height-250);
[self addChild:self.tapToFlyLabel];
Everything works fine while running on 'iPhone retina 3.5', 'iPhone retina 4.0' simulators, also on iPhone 5 device iOS 7. However, it crashes on 'iPhone retina 64-bit with the following error:
*** Terminating app due to uncaught exception 'Attemped to add nil node', reason: 'Attemped to add nil node to parent: <SKScene> name:'(null)' frame:{{0, 0}, {568, 320}}'
What is the reason for the crash? Any way to fix it? Thanks!
Solution
OTHER TIPS
Hey I ran into this problem before. It looks like the 7.0 version of SpriteKit is not using the exact same engine with the one in 7.1, and the later has a lot less bugs like this. I have tested the same code on two environment and apparently what seems to be buggy in 7.0 behaves just fine in 7.1.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow