Xcode不使用IOS 8 SDK合成属性
因此,我有一个自定义类,它在iOS 7中运行良好Xcode不使用IOS 8 SDK合成属性,ios,objective-c,Ios,Objective C,因此,我有一个自定义类,它在iOS 7中运行良好 @interface SKBButtonNode : SKSpriteNode @property (nonatomic, strong) SKTexture *normalTexture; 它在iOS7和appstore中的构建上运行良好。由于iOS 8,我的游戏在发布时崩溃。我将问题定位到: [SKBButtonNode setNormalTexture:] unrecognized selector sent to instance 0x
@interface SKBButtonNode : SKSpriteNode
@property (nonatomic, strong) SKTexture *normalTexture;
它在iOS7和appstore中的构建上运行良好。由于iOS 8,我的游戏在发布时崩溃。我将问题定位到:
[SKBButtonNode setNormalTexture:] unrecognized selector sent to instance 0x7fb50b6c41d0'
这是怎么回事?如果我对该属性进行了语法化,它就可以正常工作。我也遇到了同样的问题,原始帖子评论中来自Borrden的线索帮助我找到了解决方法。似乎是iOS8中与normalTexture的名称冲突导致了崩溃 我在button节点类中将normalTexture重命名为myNormalTexture(.h和.m文件),解决了这个问题 在.h文件中: @属性(非原子、读写、强)SKTexture*myNormalTexture 在.m文件中,对以下内容进行更改:
- (instancetype)initWithTextureNormal:(SKTexture*)正常选定:(SKTexture*)选定禁用:(SKTexture*)禁用
- (void)setIsEnabled:(BOOL)isEnabled
- (无效)setIsSelected:(BOOL)isSelected
setNormalTexture
的代码吗?你是在使用这个whiten这个SKBButtonNode类,还是在调用另一个类中的一个SKBButtonNode实例?我想我已经本地化了这个,但是没有回复这个帖子。新的Xcode实际上迫使您同时拥有setter和getter,如果您自定义它们中的任何一个的话。以前我只有自定义的getter,但没有setter。一旦我把它修好,它就工作了