September 2002
Intermediate to advanced
1272 pages
31h 12m
English
The Apple Objective-C runtime provides many C functions for interacting with the runtime. Most of the runtime functions are described in Appendix A. However, four runtime functions are used commonly and deserve explanation here.
Class NSClassFromString(NSString *aClassName) NSString *NSStringFromClass(Class aClass) NSString *NSStringFromSelector(SEL aSelector) SEL NSSelectorFromString(NSString *aSelectorName)
The first two methods convert from a string to a reference to the class named by the string and back. Uses of NSClassFromString() include allowing a user to input the name of a class to use. For example, an application could parse a text configuration file that specifies which classes to use in the application.
The ...
Read now
Unlock full access