Reputation: 40496
Since iOS5, UIKit can be customized with custom images. We have an app which must stay compatible with iOS 4, but if a user has iOS 5 we want to customize a slider.
Example:
[[UISlider appearance] setMaximumTrackImage:maxImage forState:UIControlStateNormal];
What's a safe way for checking at runtime if it's OK to do this call? The respondsToSelector: method is for instances only, but here it's a class itself.
Upvotes: 2
Views: 5169
Reputation: 16719
You can use resolveClassMethod: for that, e.g.:
[MYClass resolveClassMethod: @selector(trololo)];
Or you can use respondsToSelector: since classes are also objects in Objective C.
Upvotes: 8