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 ???
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 ???
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.