1

http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIControl_Class/Reference/Reference.html#//apple_ref/occ/cl/UIControl

addTarget:action:forControlEvents: Adds a target and action for a particular event (or events) to an internal dispatch table.

I can't underStand the dispatch table.

the table in UIControl or UIApplication or other place ???

user1292717
  • 173
  • 10

1 Answers1

1

from "Programming iOS 5 by Matt Neuburg (O'Reilly)"

A control maintains an internal dispatch table: for each control event there is some number of target-action pairs, of which the action is a selector (the name of a method) and the target is the object to which that message is to be sent. When a control event occurs, the control consults its dispatch table, finds all the targer-action pairs associated with that control event, and sends each action message to the corresponding target.

enter image description here

beryllium
  • 29,669
  • 15
  • 106
  • 125