Xcode does not synthesize property with iOS 8 SDK

So, I have a custom class that works fine in iOS 7.

@interface SKBButtonNode : SKSpriteNode @property (nonatomic, strong) SKTexture *normalTexture; 

It works great on iOS7 and creates it in the AppStore. Starting with iOS 8, my game crashes on launch. I localized the problem:

 [SKBButtonNode setNormalTexture:] unrecognized selector sent to instance 0x7fb50b6c41d0' 

What's up with that? If I mount the property, it works fine.

0
ios objective-c
Oct 31 '14 at 8:44
source share
1 answer

I had the same problem, and a hint from borrrden in the comments on the original post helped me figure out how to resolve it. It appears that the name conflict with normalTexture in iOS8 caused a crash.

I went through and renamed normalTexture in the node class to myNormalTexture (.h and .m files) and solved this problem.

In the .h file:

@property (nonatomic, readwrite, strong) SKTexture * myNormalTexture;

In the .m file, make the changes:

  • (instancetype) initWithTextureNormal: (SKTexture *) selected normally: (SKTexture *) selected disabled: (SKTexture *) disabled

  • (voids) setIsEnabled: (BOOL) IsEnabled

  • (voids) setIsSelected: (BOOL) IsSelected

+1
Dec 28 '14 at 15:46
source share



All Articles