I set base sdk 4.1 and ios deployment target = ios4.1. The contentScaleFactor is available in iOS 4.0 and later.
if ( [imageView respondsToSelector: @selector (contentScaleFactor:)] == YES )
{
imageView.contentScaleFactor = 1.0;
}
Why do i always get NO ?
It does not respond to
contentScaleFactor:becausecontentScaleFactoris a property, with the following accessors:There is no other method with the name
contentScaleFactorthat accepts a single parameter (marked by the:).So, the selectors available are
contentScaleFactorandsetContentScaleFactor:. You are probably looking forsetContentScaleFactor:, that’s what the setter is called.Change your code to this: