NSNotificationCenter vs delegation( using protocols )?

EEE picture EEE · Dec 18, 2009 · Viewed 20k times · Source

What are the pros and cons of each of them?
Where should I use them specifically?

Answer

notnoop picture notnoop · Dec 18, 2009

The rule of thumb here is how many clients would like to be notified of an event. If it's mainly one object (e.g. to dismiss a view or to act upon a button clicked, or to react to a failed download) then you should use the delegate model.

If the event you emit may be of an interest to many objects at once (e.g. screen rotated, memory usage, user login/logout), then you should use the NSNotificationCenter.