Convenience initialiser of CIFilter is giving strange exception

感情迁移 提交于 2019-12-06 13:40:30

问题


Here is the code I am trying,

typealias Parameters = Dictionary<String, AnyObject>

extension CIFilter {
    convenience init(name: String, parameters: Parameters) {
        self.init(name: "CIGloom")
        setDefaults()
        for (key, value: AnyObject) in parameters {
            setValue(value, forKey: key)
        }
    }

    var outPutImage: CIImage {
        return self.valueForKey(kCIOutputImageKey) as CIImage
    }
}

The exception is occurring during self.init(name: "CIGloom"), I tried different filter name but the result is same.

2014-11-11 15:08:27.866 HelloCIFilter[15217:451450] +[NSObject customAttributes]: unrecognized selector sent to class 0x10e26fd28

来源:https://stackoverflow.com/questions/26862019/convenience-initialiser-of-cifilter-is-giving-strange-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!