Mac Cocoa |
Author |
Message |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Thu May 15, 2014 12:15 am Post subject: KVO |
|
|
ianthehenry.com - If KVO is right, why does it feel so wrong?
"There are enough concepts in those three short lines that it will take
another blog post to do them justice. But I hope that I've piqued your
curiosity enough that you'll go investigate for yourself. How does that
work? Why was it so easy? Why isn't everyone using ReactiveCocoa
all the time? How have I never heard of this before?" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat Feb 24, 2018 3:05 pm Post subject: |
|
|
so - Do something on each property change
"Basically you need to call addObserver:forKeyPath:options:context: and
register to be notified when the properties change. When this happens, the
runtime calls the observeValueForKeyPath:ofObject:change:context: method
on the object registered as observer. You can do here the saving you want to
do." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Dec 21, 2018 11:47 am Post subject: |
|
|
NSHipster - Key-Value Observing
"Key-Value Observing has the worst API in all of Cocoa. It's awkward,
verbose, and confusing. And worst of all, its terrible API belies one of
the most compelling features of the framework." |
|
Back to top |
|
|
|