• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Add KVO for observing center property from a UIImageView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Add KVO for observing center property from a UIImageView


  • Subject: Add KVO for observing center property from a UIImageView
  • From: Tales Pinheiro de Andrade <email@hidden>
  • Date: Thu, 23 Jun 2011 20:27:30 -0300

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 (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

  • Follow-Ups:
    • Re: Add KVO for observing center property from a UIImageView
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: constrained window resizing
  • Next by Date: Re: Add KVO for observing center property from a UIImageView
  • Previous by thread: Re: tableView: objectValueForTableColumn: row: method not getting called
  • Next by thread: Re: Add KVO for observing center property from a UIImageView
  • Index(es):
    • Date
    • Thread