EXC_BAD_ACCESS while running app on device

308 views Asked by At

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.

2

There are 2 answers

4
Corb3nik On BEST ANSWER

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.

0
shabista JD On

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.