I’m trying to detect an iOS 6-specific appearance method, by running respondsToSelector
on the [UIBarButtonItem appearance]
. However, it always ret
Don't check the appearance proxy. You can never rely on that, since it's a proxy. Instead, directly check the item that has the new method, in this case, the UIBarButtonItem
:
BOOL hasNewMethod = [UIBarButtonItem instancesRespondToSelector:@selector(setBackgroundImage:forState:style:barMetrics:)];
if( hasNewMethod )
NSLog(@"Running iOS 6 with new method");
else
NSLog(@"Current OS doesn't support method...");