ios - kCGImagePropertyOrientation incompatible pointer -


I am implementing Auto Enhancing in my app. My code goes like this: < Pre> cimage * toBeEnhancedImage = [CIImage imageWithCGImage: _originalImage.CGImage]; NSDictionary * Options = @ {CIDetectorImageOrientation: [[toBeEnhancedImage properties] valueForKey: kCGImagePropertyOrientation]}; NSArray * Adjustment = [toBeEnhancedImage Automatic Adjustment Filter Options Options: Options]; Before running the code, I get the following error next to the NSDictionary:

Incompatible pointer type 'const cf string reef send (aka' const struct__CFString const ) type NSString * in parameters

When I run the code, it crashes. I know what the error means but the code is actually taken from Apple's documents and it does not work! Is there any remedy?

Your CFStringRef variable nsstaining * . Change the second line of your code with the following line:

  NSDictionary * options = noil; If ([[toBeEnhancedImage properties] valueForKey: (NSString *) kCGImagePropertyOrientation] == zero) {options = @ {CIDetectorImageOrientation: [NSNumber numberWithInt: 1]}; } Other {options = @ {CIDetectorImageOrientation: [[toBeEnhancedImage properties] valueForKey: (NSString *) kCGImagePropertyOrientation]}; }    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -