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

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -