Skip to content

Instantly share code, notes, and snippets.

@pbrewczynski
Created October 15, 2013 10:26
Show Gist options
  • Save pbrewczynski/6989562 to your computer and use it in GitHub Desktop.
Save pbrewczynski/6989562 to your computer and use it in GitHub Desktop.
Delegation and Notifications
The delegate of most Cocoa framework classes is automatically registered as an observer of notifications posted by the delegating object. The delegate need only implement a notification method declared by the framework class to receive a particular notification message. Following the example above, a window object posts an NSWindowWillCloseNotification to observers but sends a windowShouldClose: message to its delegate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment