> On Aug 28, 2014, at 8:25 PM, Graham Cox <graham....@bigpond.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to