Xcode不会与IOS 8 SDK合成属性

所以我有一个在iOS 7中工作正常的自定义类。

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

它在iOS7上工作得很好,并且构build在appstore中。 由于iOS 8我的游戏发射崩溃。 我将问题本地化为:

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

这是怎么回事? 如果我合并财产,它工作正常。

我也遇到了同样的问题,从评论中发表的原始post中的线索帮助我弄清楚了如何解决这个问题。 它看起来像在iOS8正常纹理的名称冲突导致崩溃。

我浏览并将button节点类中的normalTexture重命名为myNormalTexture(.h和.m文件),并解决了此问题。

在.h文件中:

@属性(非primefaces,读写,强)SKTexture * myNormalTexture;

在.m文件中更改为:

  • (instancetype)initWithTextureNormal:(SKTexture *)正常select:(SKTexture *)select禁用:(SKTexture *)禁用

  • (空隙)setIsEnabled:(BOOL)的IsEnabled

  • (空隙)setIsSelected:(BOOL)isSelected