Custom Controls
Cocoa offers a rich set of user interface controls. Even so, there are times when a custom control is desired. Usually, the controls provided in Cocoa are sufficient if enough creativity is employed. New kinds of controls can be confusing to users, so they should be avoided unless absolutely necessary.
Much of the time it is possible to subclass an existing control, making just a minor alteration in the standard behavior. Because each control is a little different, it is beyond the scope of this book to show the subtle details of how to subclass every kind of control. Instead, an example of subclassing the NSControl and NSActionCell classes directly is shown. The techniques used in the example show more about the internals of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access