1
는 다음 코드를 사용하여 CIAdditionCompositing 필터를 설정하기 위해 노력하고있어 :CIAdditionCompositing 필터를 설정할 때 NSUnknownKeyException이 나타나는 이유는 무엇입니까?
CIImage *imageOne = [CIImage imageWithCGImage:[UIImage imageNamed:@"picOne"].CGImage];
CIImage *imageTwo = [CIImage imageWithCGImage:[UIImage imageNamed:@"picTwo"].CGImage];
filter = [CIFilter filterWithName:@"CIAdditionCompositing"];
[filter setDefaults];
[filter setValue:imageOne forKey:kCIInputImageKey];
[filter setValue:imageTwo forKey:kCIInputBackgroundImageKey];
CIImage *imageResult = [filter outputImage];
CGImageRef imageRef = [context createCGImage:imageResult fromRect:imageResult.extent];
_imageView.image = [UIImage imageWithCGImage:imageRef];
을 다음과 같은 오류보고 있어요 : 라인
[filter setValue:imageOne forKey:kCIInputImageKey];
무엇 오전에
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<__NSCFConstantString 0x2e2d60> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key inputImage.'
을 이 코어 이미지 필터의 설정에 문제가 있습니까?
더 많은 정보를 제공 할 수 있다면 도움이 될 것입니다. 예를 들어, 어떤 라인이 예외를 던지고 있습니까? – Ting
예외 - UnknownKey! kCIInputImageKey = @ "inputImage" – TESTer