ios - kCGImagePropertyOrientation incompatible pointer -
I am implementing Auto Enhancing in my app. My code goes like this: < Pre> 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 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:
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
Post a Comment