Tuesday, September 23, 2008

5. After the Custom View is created

View Programming Guide for Cocoa points out some foundamental steps a developer has to take in consideration when creating a custom view class. They are listed in the Creating a Custom View chapter.
  1. Providing methods to allocate and deallocate the view.
  2. Drawing the view content.
  3. Marking portion of the view for updating in response to value changes.
  4. Responding to mouse events produced by user interaction.
  5. Updating mouse pointer when it is over a draggable item.
  6. Responding to keyboard events.
  7. Implementing NSResponder actions methods.
  8. Providing key-value-coding compliant accessors for its settable properties.
An important guide to understand Event Handling in Cocoa is Cocoa Event-Handling Guide. This guide covers tips regarding mouse and keyboard events and also NSResponder class.
Another foundamental document is Key-Value Coding Programming Guide that explains point 8.

No comments: