ios - Key-value observation: Can I observe for changes on ALL properties? -
whenever property on object changed or updated want change variable (nonce variable). nonce time-based. everytime property updated nonce gets updated current time.
is there way automatically listen key changes on object? or have manually maintain keyvalue observers each property separately?
many thanks
did take @ obj-c runtime functions? see here in docs. example, gives list of properties in class lender
. (btw: i'm not @ mac, straight out of docs):
@interface lender : nsobject { float alone; } @property float alone; @end
you can list of properties using:
id lenderclass = objc_getclass("lender"); unsigned int outcount; objc_property_t *properties = class_copypropertylist(lenderclass, &outcount);
you can name of property:
const char *property_getname(objc_property_t property)
if pipe names addobserver:forkeypath:options:context
should golden.
Comments
Post a Comment