ios – ‘UIInterpolatingMotionEffect’没有可见的@interface声明选择器’initWithKeyPath:type:’

概述我有和UIInterpolatingMotionEffect类问题,应用程序编译,但当我尝试存档时,我得到了这个编译错误: ‘UIInterpolatingMotionEffect’没有可见的@interface声明选择器’initWithKeyPath:type:’ 我在此函数上的UIInterpolatingMotionEffect的初始化程序中出现此错误: - (void)addMotion 我有和UIInterpolatingMotionEffect类问题,应用程序编译,但当我尝试存档时,我得到了这个编译错误:

‘UIInterpolatingMotionEffect’没有可见的@interface声明选择器’initWithKeyPath:type:’

我在此函数上的UIInterpolatingMotionEffect的初始化程序中出现此错误:

- (voID)addMotionEffects{    UIInterpolatingMotionEffect *horizontalMotionEffect = [[UIInterpolatingMotionEffect alloc]                                                           initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];    horizontalMotionEffect.minimumrelativeValue = @(-20);    horizontalMotionEffect.maximumrelativeValue = @(20);    UIInterpolatingMotionEffect *verticalMotionEffect = [[UIInterpolatingMotionEffect alloc]                                                         initWithKeyPath:@"center.y" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];    verticalMotionEffect.minimumrelativeValue = @(-20);    verticalMotionEffect.maximumrelativeValue = @(20);    UIMotionEffectGroup *group = [UIMotionEffectGroup new];    group.motionEffects = @[horizontalMotionEffect,verticalMotionEffect];    [self.containerVIEw addMotionEffect:group];}

我认为在尝试编译arm64架构时是一种错误,但我无法弄清楚如何解决问题.

有任何想法吗?

解决方法 这是一个WTF的答案,也是一个WTF问题,但有效……

为了避免编译错误,我使用提供错误的选择器为UIInterpolatingMotionEffect创建了一个类别.但是仍然不知道为什么Xcode没有这个存档…

@interface UIInterpolatingMotionEffect (lol)- (instancetype)initWithKeyPath:(Nsstring *)keyPath type:(UIInterpolatingMotionEffectType)type;@end
总结

以上是内存溢出为你收集整理的ios – ‘UIInterpolatingMotionEffect’没有可见的@interface声明选择器’initWithKeyPath:type:’全部内容,希望文章能够帮你解决ios – ‘UIInterpolatingMotionEffect’没有可见的@interface声明选择器’initWithKeyPath:type:’所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1025738.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存