Re: Looking up a NSString constant at runtime
Re: Looking up a NSString constant at runtime
- Subject: Re: Looking up a NSString constant at runtime
- From: glenn andreas <email@hidden>
- Date: Mon, 04 Jan 2010 18:24:41 -0600
On Jan 4, 2010, at 6:13 PM, Graham Cox wrote:
>
> On 05/01/2010, at 11:03 AM, David Alter wrote:
>
>> I can open a library and lookup a function by name using dlsym. These
>> constants are EXTERN. It seams there should be away to look these up as
>> well.
>
> Functions are not the same, because a function's name is a necessary part of the runtime. A constant's name is just a convenience for the programmer and doesn't make it into the binary.
>
> There is no built-in standard way to do this - you're on your own.
CFBundle has routines for looking up both functions and data by name. It does require you figure out what framework the symbol comes from (and then get the corresponding CFBundle), but it is doable.
Glenn Andreas email@hidden
The most merciful thing in the world ... is the inability of the human mind to correlate all its contents - HPL
_______________________________________________
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