Format specifies type 'int' but the argument has type 'UIViewContentMode' <p>I am getting a warning in Xcode:</p> <blockquote> <p>Format specifies type 'int' but the argument has type 'UIViewContentMode'</p> </blockquote> <p>I have a method that I am using to resize an <code>UIImage</code> as follows:</p> <pre><code>- (UIImage *)resizedImageWithContentMode:(UIViewContentMode)contentMode bounds:(CGSize)bounds interpolationQuality:(CGInterpolationQuality)quality { CGFloat horizontalRatio = bounds.width / self.size.width; CGFloat verticalRatio = bounds.height / self.size.height; CGFloat ratio; switch (contentMode) { case UIViewContentModeScaleAspectFill: ratio = MAX(horizontalRatio, verticalRatio); break; case UIViewContentModeScaleAspectFit: ratio = MIN(horizontalRatio, verticalRatio); break; default: [NSException raise:NSInvalidArgumentException format:@"Unsupported content mode: %d", contentMode]; } ... </code></pre> <p><code>UIViewContentMode</code> seems to reference an Integer so I am not sure on this warning:</p> <pre><code>typedef NS_ENUM(NSInteger, UIViewContentMode) { UIViewContentModeScaleToFill, UIViewContentModeScaleAspectFit, // contents scaled to fit with fixed aspect. remainder is transparent UIViewContentModeScaleAspectFill, ... </code></pre> <p>How can I get rid of this warning it seems to be incorrect? Is the <code>NSLog</code> in the exception correct? </p>