Sometime we need to check to see if a class is available before using it. For example, Twitter Framework is integrated into iOS SDK from version 5.0. For the earlier versions, Twitter Framework is unavailable.
To do this check, we can use NSClassFromString method to determine if the class is available.
Class TweetViewController = NSClassFromString(@"TWTweetComposeViewController");
if (TweetViewController != nil) {
...
}
else {
...
}