Frage

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.

War es hilfreich?

Lösung

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.

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top