任何想法如何解决以及为什么这是Xcode 7中的一个问题?
Incompatible block pointer types sending ‘voID (^)(SKSpriteNode *__strong,NSUInteger,BOol *)’ to parameter of type ‘voID (^ _Nonnull)(SKNode * _Nonnull __strong,BOol * _Nonnull)’
[self.children enumerateObjectsUsingBlock:^(SKSpriteNode * node,NSUInteger IDx,BOol *stop){ float parallaxRatio = [(NSNumber *)node.userData[@"ParallaxRatio"] floatValue]; CGPoint childVeLocity = CGPointMultiplyScalar(self.veLocity,parallaxRatio); CGPoint offset = CGPointMultiplyScalar(childVeLocity,deltaTime); node.position = CGPointAdd(node.position,offset);}];解决方法 iOS9 / Xcode7似乎改变了几个界面.在这种情况下,您最容易修复它,通过键入[self.children枚举,然后按Ctrl空间并从列表中选择适当的方法.这将为您提供具有新块指针类型的代码片段,您可以在其中移动代码.
结果是:(节点在自动完成后是obj,我只是将其重命名)
[self.children enumerateObjectsUsingBlock:^(SKNode * _Nonnull node,BOol * _Nonnull stop) { float parallaxRatio = [(NSNumber *)node.userData[@"ParallaxRatio"] floatValue]; CGPoint childVeLocity = CGPointMultiplyScalar(self.veLocity,offset);}];总结
以上是内存溢出为你收集整理的ios – Xcode 7 – 不兼容的块指针类型全部内容,希望文章能够帮你解决ios – Xcode 7 – 不兼容的块指针类型所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)