I am trying to check for the existence of the UIAppearance class using:
NSClassFromString(@"UIAppearance")
However, this returns nil from iOS4 and iOS5 - who has any tips on how to get around this?
UIAppearance is not a class, it is a protocol. Therefore, to check if this exists or not, you should use:
NSProtocolFromString(@"UIAppearance");
It returns null in <iOS5, but an object on iOS5.
This may come in handy:
List of classes supporting UIAppearance in iOS 5
Source: https://habr.com/ru/post/1411061/More articles:Check if file is real or symbolic link - c #How to set encoding of type encoded UTF-16 in TextView in android - androidWhat is a good general purpose, lightweight CSS structure? - designjQuery adds a paragraph twice - jqueryUsing a parameter as a variable name inside a function in R - rTransferring data from the view controller to the Cocos2D scene - iosAndroid snippets at lower API - androidStreaming audio from Google App Engine - google-app-engineeclipse - create a template for log method arguments - javaWhere can I get the S. Heymann SIFT algorithm? - algorithmAll Articles