0

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.

shabista JD
  • 115
  • 7
  • I'm not very familiar with the classes you are using, the error seems to be when you are trying to access the kCIInputCenterKey key. Is it created on your device? – Corb3nik Dec 04 '13 at 06:19
  • its not throwing any error description on debug area just EXC_BAD_ACCESS (code=1 address=0x0) on the line of code – shabista JD Dec 04 '13 at 06:21
  • can you step in CIVector? seems to you are passing invalid inputs to it . – Kunal Balani Dec 04 '13 at 06:24
  • 1
    If it is on Device only, then check with your resources_Names (Case Sensitive). – Kumar KL Dec 04 '13 at 06:24

2 Answers2

1

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.

Corb3nik
  • 1,177
  • 7
  • 26
0

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.

shabista JD
  • 115
  • 7