NSNotificationCenter

The NSNotificationCenter is the brains of the operation. It allows you to do three things: register observer objects, post notifications, and unregister observers.

Here are some commonly used methods implemented by NSNotificationCenter:

c​l​a​s​s​ ​f​u​n​c​ ​d​e​f​a​u​l​t​C​e​n​t​e​r​(​)​ ​-​>​ ​N​S​N​o​t​i​f​i​c​a​t​i​o​n​C​e​n​t​e​r​

Returns the notification center.

f​u​n​c​ ​a​d​d​O​b​s​e​r​v​e​r​(​o​b​s​e​r​v​e​r​:​ ​A​n​y​O​b​j​e​c​t​,​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​s​e​l​e​c​t​o​r​ ​a​S​e​l​e​c​t​o​r​:​ ​S​e​l​e​c​t​o​r​,​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​n​a​m​e​ ​a​N​a​m​e​:​ ​S​t​r​i​n​g​?​,​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​o​b​j​e​c​t​ ​a​n​O​b​j​e​c​t​:​ ​A​n​y​O​b​j​e​c​t​?​)​

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.