Explain differences between KVO and NSNotificationCenter
Utilisateur anonyme
Key-Value Observing is the process by which one object is alert to changes to another objects property. NSNotifications are events broadcasted to the NSNotificationCenter, which delivers these events to any objets listening for that specific notification. The difference is specificity. KVO is usually used to track specific changes to an object (i.e. a ‘text’ property) while NSNotifications are used to track generic “events” (Like a user finishing up the signUp flow). KVO will automatically give you useful information, such as the previous value of a property and the type of change that occurred: NSNotifications only emit whatever extra metadata you explicitly specify.