O'Reilly logo

Cocoa Design Patterns by Donald A. Yacktman, Erik M. Buck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9. Perform Selector and Delayed Perform

Selectors identify the messages that are sent to Objective-C objects. They’re used by the receivers of messages to select which methods will be performed. Selectors provide much of the power, flexibility, and dynamism of the Objective-C language, and they’re used to implement other Cocoa design patterns. In particular, selectors are key to Cocoa’s implementation of the Notifications, Delegates, Targets and Actions, Invocations, and Forwarding patterns. Using selectors, Cocoa objects can be asked to perform methods immediately or after arbitrary time delays. Delaying the performance of methods can be very handy and is sometimes used to keep a user interface responsive while long-running tasks complete, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required