• 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
Re: Synthesized properties for scalars not KVO compliant
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Synthesized properties for scalars not KVO compliant


  • Subject: Re: Synthesized properties for scalars not KVO compliant
  • From: Andy Lee <email@hidden>
  • Date: Wed, 20 May 2009 00:15:26 -0400

On May 19, 2009, at 7:52 PM, Kiel Gillard wrote:
I have a few scalar (NSUInteger, CGRect etc) ivars in my model objects. I have declared identically named properties for these scalars and instructed the compiler to synthesize accessor methods for them. My controller objects add themselves to the model objects as observers with the keypaths to the scalars.

Sounds right, should work.

However, I'm not getting any key-value observing notifications when changes to those observed properties occur (observeKeyPath... isn't being called at all).

I feel I may be missing something very simple but I have no idea what. Any suggestions?

Use NSLog and/or the debugger to question everything. You say the controllers are adding themselves as observers; are they doing so as self, or is there a variable that you think is pointing to a controller, but might be nil? You say changes to the properties are occurring and you're not setting the ivars directly; how *are* you setting the property? If it's through code, are you positive the object you're modifying is == to the object you observed? How are you confirming that the property is actually getting changed?


--Andy

_______________________________________________

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


References: 
 >Synthesized properties for scalars not KVO compliant (From: Kiel Gillard <email@hidden>)

  • Prev by Date: Re: Clarification on custom NSFormatter
  • Next by Date: Re: Debugging ineffective binding?
  • Previous by thread: Re: Compiler does not synthesize KVO compliant properties for CATiledLayer subclass (was: Synthesized properties for scalars not KVO compliant)
  • Next by thread: Only One Reason to ever use Transient Properties in Core Data
  • Index(es):
    • Date
    • Thread