Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why properties method of CIImage returns nil

I'm developing an application using coreImage framework.I created a CIImage from UIImage.

CIImage *image = [CIImage imageWithCGImage:self.canvasImage.CGImage];

here self.canvasImage is a UIImage,I debug it and object image is being created by compiler with some memory.

i'm creating a NSDictionary object returned by properties method using following code.

NSDictionary *opts  =[image properties] ;

here my opts object is being assign with nil value.

i searched it but didn't found the solution,why properties method is returning nil value?

like image 321
shabista JD Avatar asked Nov 29 '13 05:11

shabista JD


1 Answers

I was having this same problem. Turns out the properties dictionary is only non nil if you use the imageWithData: or imageWithContentsOfURL: to create the CIImage.

It's not documented well at all. Check out WWDC 2013 session 509.

like image 71
farhad Avatar answered Nov 07 '22 17:11

farhad