Answer the question
In order to leave comments, you need to log in
Is it possible to track changes to all properties of an NSObject?
Only one way comes to mind: get a list of all properties through runtime and in a loop do addObserver for each field.
Are there other, less artisanal options?
Answer the question
In order to leave comments, you need to log in
here, I devoted almost a whole report to this problem at the conference, I hope it will be interesting :)
habrahabr.ru/company/e-Legion/blog/214861
I guess it depends on what you want to catch. Moreover, not all properties of KV-Observable.
If you want to track changes through setters, you can try to overload methodForSelector: or make method swizzling on it. There, to determine which selector is called, if it starts with "set", then the value is expected to change. We call our handler, we call the original method.
Tell us more about the problem, it will be easier to answer more specifically
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question