Re: Extending KVO to scalar struct types?
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