Maybe I miss something, but it seems, the standard KVO does not work
for properties whose values are non-objects, say int, float etc.
How can I effortless accomplish to observe at such properties?
For instance:
@interface Model {
int value;
}
@property int value;
@end
@interface Observer {
}
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
change:(NSDictionary *)change context:(void
*)context;
@end
// Register an observer:
Model model* = [[Model alloc] init];
Observer* observer = [[Observer alloc] init];
[model addObserver:observer forKeyPath:@"value" options:0 context:NULL];
And, btw., how can Model determine whether an observer is added to one
of its properties?
Thanks in advance
Regards
Andreas
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com