Xcode 7 – 不兼容的块指针types
这段代码在Xcode 6中工作正常,但现在不能在Xcode 7中编译。任何想法如何解决,为什么这是Xcode 7中的问题?
不兼容的指针types将'void(^)(SKSpriteNode * __ strong,NSUInteger,BOOL *)'发送给types为'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); }];
iOS9 / Xcode7中有几个界面已经改变了。 在这种情况下,你最容易修复它,通过input[self.children enum
,然后按Ctrl + 空间,并从列表中select适当的方法。 这会给你一个新的块指针types的代码片段,你可以在那里移动代码。
结果会是这样的:(自动完成后node
是obj
,我只是重命名了它)
[self.children enumerateObjectsUsingBlock:^(SKNode * _Nonnull node, NSUInteger idx, BOOL * _Nonnull 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); }];
- 我如何检查移动数据或无线networking打开或closures。 ios迅速
- validation错误:该软件包包含不允许的文件“Frameworks”
- 如何使appiumtesting在iOS上运行得更快?
- Swift 2.0 Facebook Friend Friend的代码
- 没有AVAsset的纯色的AVMutableComposition
- 架构armv7的未定义符号:cocoaPods iPhone 5
- 目标c如何设置整个应用程序的所有UIbutton的独家触摸
- AES-256encryption和苹果iTunes导出限制
- GPUImagePicture与imageFromCurrentlyProcessedOutput不会得到UIImage