简体   繁体   English

为什么我收到CIFilter的“无法识别的选择器发送给类”错误?

[英]Why am I getting an “unrecognized selector sent to class” error for CIFilter?

This code works on an iPad 2 simulator, but not on my physical iPad 2 (which is running on iOS 7.0.6): 此代码可在iPad 2模拟器上运行,但不能在我的物理iPad 2(在iOS 7.0.6上运行)上运行:

var fade = CIFilter(name: "CIExposureAdjust", withInputParameters:["inputEV" : -2.0 ])

The full error message says: 完整的错误消息显示:

[CIFilter filterWithName:withInputParameters:]: unrecognized selector sent to class 0x392d8d9c 2015-07-05 23:12:37.106 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[CIFilter filterWithName:withInputParameters:]: unrecognized selector sent to class 0x392d8d9c' [CIFilter filterWithName:withInputParameters:]:无法识别的选择器发送到类0x392d8d9c 2015-07-05 23:12:37.106 ***由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'+ [CIFilter filterWithName:withInputParameters:]:无法识别选择器发送到类0x392d8d9c'

Check the official documentation of + filterWithName:withInputParameters: 查看+ filterWithName:withInputParameters:的官方文档+ filterWithName:withInputParameters:

+ filterWithName:withInputParameters:

Availability 可用性
Available in iOS 8.0 and later. 在iOS 8.0和更高版本中可用。

Since your iPad is running on iOS 7, this method is not available, and therefore your app crashes. 由于您的iPad在iOS 7上运行,因此此方法不可用,因此您的应用程序崩溃了。

A few possible solutions: 一些可能的解决方案:

  1. Use - respondsToSelector: to check if the method exists. 使用- respondsToSelector:检查该方法是否存在。

  2. Check if the current foundation version number, NSFoundationVersionNumber is higher than NSFoundationVersionNumber_iOS_7_1 . 检查当前基础版本号NSFoundationVersionNumber是否高于NSFoundationVersionNumber_iOS_7_1

  3. Make iOS 8 a minimum requirement for your app. 将iOS 8设为您的应用程序的最低要求。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我会收到发送到 class 的无法识别的选择器? - Why am I getting unrecognized selector sent to class? 为什么我得到一个“无法识别的选择器发送到实例”错误? - Why am I getting a `unrecognized selector sent to instance` error? 选择器语法:为什么我得到无法识别的选择器错误? - selector syntax: why I am getting unrecognized selector error? 为什么我得到这个:_cfurl:无法识别的选择器 - Why am I getting this: _cfurl: unrecognized selector 为什么我会收到“ [__NSArrayI allKeys]:无法识别的选择器发送到实例” /为什么要进行NSDictionary转换? - Why am I getting “[__NSArrayI allKeys]: unrecognized selector sent to instance” / why is NSDictionary transforming? 为什么我的MapViewController收到无法识别的选择器发送到实例异常? (iOS) - Why am I getting a unrecognized selector sent to instance exception with my MapViewController? (iOS) 我认为我在分配segmentcontrol时犯了一些错误。我遇到了一个错误[无法识别的选择器发送到实例] - I think i have done some mistake in allocating segmentcontrol..i am getting an error [unrecognized selector sent to instance] 当我单击按钮时,为什么会出现“无法识别的选择器”错误? - Why am I getting a “unrecognized selector” error when I click on a button? Xcode NSTimer 错误:无法识别的选择器发送到类 - Xcode NSTimer error: Unrecognized selector sent to class CCLabelTTF错误:无法识别的选择器已发送给课程 - CCLabelTTF Error: unrecognized selector sent to class
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM