I\'m writing my first iPhone app, and I\'ve been exploring the design patterns in Cocoa Touch and Objective-C. I come from a background of client-side web development, so I
EDIT: Another good post: NSNotificationCenter vs delegation( using protocols )?
A delegate is a callback so there is a 1:1 relationship. The delegate is a single instance of an object that implements a formal protocol.
Notifications (events) are basically broadcasts to many objects that are interested in when something happens.
Delegates are good for being able to interject code into the pipeline of some other objects processing such as before and after callbacks, providing data sources for a control and communicating between views:
What exactly does delegate do in xcode ios project?
Therefore delegates have a much tighter relationship with the object since they are the single provided object to interject and alter processing of the object or provide data. You're deferring decisions and external operations like loading data to some other object - which is why it's a very common pattern for generic UIKit classes. Notifications to other objects is a much looser relationship - it just that a notifies others that something happened.
It's also not a "vs" question necessarily. For example you could have an app that does background processing and it fired a something changed notification causing a view to call its data source delegate to refresh its view. They are two different mechanisms.