【发布时间】:2015-09-22 19:04:09
【问题描述】:
此代码在 Xcode 6 中运行良好,但现在无法在 Xcode 7 中编译。 任何想法如何解决以及为什么这是 Xcode 7 中的问题?
不兼容的块指针类型将'void (^)(SKSpriteNode *__strong, NSUInteger, BOOL *)'发送到'void (^ _Nonnull)(SKNode * _Nonnull __strong, NSUInteger, 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);
}];
【问题讨论】:
标签: ios objective-c xcode7