Hi again.

I have a custom view (say ECGlassView), subclass from UIImageView, and this 
view has a subview (say ECNeedleView) that is subclass from UIImageView.

I'm trying to add viewA as observer for viewB center, as I can move viewB above 
viewA. When I try to tho this:


[self.needle addObserver:self forKeyPath:@"needle.center" 
options:NSKeyValueObservingOptionNew context:@"needleCenter"];

the program abort, with the message:

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: 
'[<ECNeedleView 0x8b1cf30> addObserver:<ECGlassView 0x8b1bac0> 
forKeyPath:@"needle.center" options:0x1 context:0x21eec] was sent to an object 
that is not KVC-compliant for the "needle" property.'

In ECGlassView.h I have:

@interface ECGlassView : UIImageView {
    ECNeedleView *needle;
}
@property (nonatomic, assign) ECNeedleView *needle;
@end

And have synthesized needle property in ECGlassView.m file.

Even if I try to declare center property in ECNeedleView.h and synthesize it, 
it doesn't work.

What I'm doing wrong?

_______________________________________________

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

Reply via email to