Add a view as observer of a subview transform
Add a view as observer of a subview transform
- Subject: Add a view as observer of a subview transform
- From: Tales Pinheiro De Andrade <email@hidden>
- Date: Mon, 04 Jul 2011 01:40:00 -0300
Hi,
I have a view with a subview. The subview is rotated by a drag operation, when I change the subview transform property.
Now I'm trying to set the view as observer of subview transform property, like this:
[subView addObserver:self forKeyPath:@"transform" options:NSKeyValueObservingOptionNew context:@"subViewRotation"];
And in the superview I added just this:
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
NSLog(@"%@ - %@ - %@", keyPath, object, context);
}
But this code is never called.
I also tried
[subView addObserver:self forKeyPath:@"transform" options:NSKeyValueObservingOptionNew context:@"subViewRotation"];
which also didn't work.
What I'm doing wrong?
Is there a good reference about KVO? I have already read the KVO Quick start guide and Key-Value Observing Programming Guide, but maybe someone have a better reference.
Thank you
Tales
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden