문제

I'm developing an application using Core Image framework.Everything is working fine on simulator but when i'm running the app on device,my app gets crash with EXC_BAD_ACCESS on following piece of code.

CIFilter *myFilter = [CIFilter filterWithName:@"CIBumpDistortion"]; 
    [myFilter setDefaults]; 


    [myFilter setValue: [CIImage imageWithCGImage:[self.storyBoardImage CGImage]] forKey: kCIInputImageKey];//<----self.storyBoardImage is an UIImage and not being released.


[myFilter setValue: [CIVector vectorWithX:self.leftEyePosition.x Y:self.leftEyePosition.y]
                          forKey: kCIInputCenterKey];<-------Here my app crashed(EXC_BAD_ACCESS ) 

note:I'm using ARC in my app.

도움이 되었습니까?

해결책

The error comes from the fact that kCIInputCenterKey isn't available on IOS. As you can see in the documentation here, it is only avaiable for OSX 10.5 and later.

That's probably the reason why it works on the simulator and not on the device itself.

다른 팁

Problem resolved the issue was: I was using kCIInputCenterKey for the input key centre of radius, but kCIInputCenterKey supports by OSX only not by iOS,therefore it was working fine on simulator but not on device.

i changed kCIInputCenterKey with @"inputCenter" and it worked.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top