• 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: Extending KVO to scalar struct types?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extending KVO to scalar struct types?


  • Subject: Re: Extending KVO to scalar struct types?
  • From: Graham Cox <email@hidden>
  • Date: Fri, 29 Aug 2014 14:09:31 +1000

On 29 Aug 2014, at 1:52 pm, Ken Thomases <email@hidden> wrote:

> In case you're not aware, certain Core Animation classes have support for this sort of thing: Core Animation Programming Guide: Key-Value Coding Extensions – Key Path Support for Structures.
> <https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreAnimation_guide/Key-ValueCodingExtensions/Key-ValueCodingExtensions.html#//apple_ref/doc/uid/TP40004514-CH12-SW8>

Ah, that's where I saw it (not bindings)


> I suspect they use type encoding to interrogate the type of the property (via its getter or setter signature, as appropriate) and then support field access for certain specific structure types they understand.


Actually that will work for me. I only need to support size, points and rects at the moment, so it's easy enough to use the -objCType to see which one I have and then just change the field according to which specific string I pass. A category on NSValue will wrap that up neatly enough.

Thanks!

--Graham



_______________________________________________

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: Extending KVO to scalar struct types?
      • From: Quincey Morris <email@hidden>
References: 
 >Extending KVO to scalar struct types? (From: Graham Cox <email@hidden>)
 >Re: Extending KVO to scalar struct types? (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Extending KVO to scalar struct types?
  • Next by Date: Re: Extending KVO to scalar struct types?
  • Previous by thread: Re: Extending KVO to scalar struct types?
  • Next by thread: Re: Extending KVO to scalar struct types?
  • Index(es):
    • Date
    • Thread