NSControl的继承图

To better understand NSControl, you should become acquainted with its ancestors: NSControl inherits from NSView, which inherits from NSResponder, which inherits from NSObject. Each member of the family tree adds some capabilities (Figure 5.3).

Figure 5.3. Inheritance Diagram for NSControl


                                                           NSControl的继承图_第1张图片


At the top of the class hierachy is NSObject. All the classes inherit from NSObject, and this is where they get the basic methods:retainreleasedealloc, and initNSResponder is a subclass of NSObject. Responders have the ability to handle events with such methods as mouseDown: and keyDown:NSView is a subclass of NSResponderNSView has a place on a window, where it draws itself. You can create subclasses of NSView to display graphs and allow the user to drag and drop data. NSControl inherits from NSView and adds the target and the action.

你可能感兴趣的:(NSControl的继承图)