Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Java doesn't have a simple, concise method for determining if an object implements a specific method. Instead, Java programs tend to create classes and interfaces that implement functional groups of methods. The programmer then tests an object for membership in those classes or interfaces. This works well in Java because of its strong type checking and strict inheritance model.
Objective-C's class structure is much more relaxed and dynamic, so the assumptions one can make in Java are not as applicable. The preferred method of determining if an object implements a particular method is to test that directly, as shown in Listing 10-1.