Which to use?

In this chapter, you have seen three kinds of callbacks. How does Apple decide which one to use in any particular situation?

  • Objects that do just one thing (like NSTimer) use target-action.

  • Objects that have more complicated lives (like an NSURLConnection) use helper objects, and the most common type of helper object is the delegate.

  • Objects that might need to trigger callbacks in several other objects (like NSTimeZone) use notifications.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset