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

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

sql server ce - Is there some way to make sqlce3.5 and 4.0 co-exist in the C# project -