NSClassFromString returns an Objective-C class based on it's name as a string (The function name is really self explanitory)...
The string you pass in is the name of the class you want to create, for example:
If you have a class called MyViewController and you want to get an Objective-C class from that string, you use this function, like NSClassFromString(@"MyViewController");
Normally you only need to do this when testing for class names that may not be available to you, for example, when writing code that targets iPhone OS 2.0 and 3.0 simultaneously.
If you use the class as a symbol, it'll crash if the class doesn't exist on the previous version of the OS. So you use this function to return a class using that string, and if the class is successfully returned, you know that it exists and is safe to use, else if it returns nil
, then the class doesn't exist, you shouldn't use it and your program should take steps to behave properly in this situation.