• 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
How do I do KVC/KVO for struct properties
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I do KVC/KVO for struct properties


  • Subject: How do I do KVC/KVO for struct properties
  • From: Derrick Bass <email@hidden>
  • Date: Thu, 16 Mar 2006 16:32:59 -0800

I'd like to support KVC for a struct (QTTime, to be specific) property of a class. I added a valueForKey: and setValueForKey: pair of methods. When they get the "time" key, they pack/unpack the QTTime from an NSValue; otherwise they call super's implementation. I also made value transformer so the table in my view can convert between strings and NSValue's containing QTTimes. That all seems to work wonderfully.

The problem is that now I'm trying to do some KVO stuff and I've discovered that notifications are not sent for changes the "time" key. Do I have to manually send these notifications in my overridden valueForKey: method? Or is overriding valueForKey: not the right way to support structs in the first place?

Thanks in advance for any help.

Derrick

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How do I do KVC/KVO for struct properties
      • From: "Greg Herlihy" <email@hidden>
  • Prev by Date: Bindings, Transformers and Sorting Table Columns
  • Next by Date: menuNeedsUpdate delegate
  • Previous by thread: Re: Bindings, Transformers and Sorting Table Columns
  • Next by thread: Re: How do I do KVC/KVO for struct properties
  • Index(es):
    • Date
    • Thread