• 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: Jens Alfke <email@hidden>
  • Date: Thu, 28 Aug 2014 20:43:34 -0700

> On Aug 28, 2014, at 8:25 PM, Graham Cox <email@hidden> wrote:
>
> The problem here is being able to get to the struct's field at runtime given its name as a string. Is that even possible?

Not in C. The closest you can get is the @encode(…) directive, which at compile-time evaluates to the type-encoding string of the argument. But that only tells you the types of the struct fields, not the names.

You might be able to do this with RTTI in C++; I've never used that.

—Jens

_______________________________________________

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: 
 >Extending KVO to scalar struct types? (From: Graham Cox <email@hidden>)

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