I have never paid attention to the reflection usage in iPhone development. java C # and so on are also reflected. It is quite convenient to use because of the current development needs, I thought of using reflection to complete it. 1. create an object Class testClass = NSClassFromString (@ "testClass") by using the Class name; id object = [[testClass alloc] init]; 2. through reflection, implement the specified function of the object, for example: I want to call the setDelegate method of the object (in fact, assign values to attributes, the same as the method), and use the following code, first, determine whether the object has such a method. If so, execute it. If ([object respondsToSelector: @ selector (setDelegate :)]) {[object callback mselector: @ selector (setDelegate :) withObject: self];} 3. how to obtain the class name NSString * className = NSStringFromClass (testClass );