On Jan 4, 2010, at 4:03 PM, 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.


You should be able to look up extern variables manually, and you can use 
CFBundleGetDataPointerForName to do so (I'm not certain there is an NSBundle 
analog).

However, doing so is highly unusual unless you are loading plugins (and even 
then it is not common in Objective-C). So the question comes back to what are 
you trying to accomplish by doing this in the first place? You mentioned you 
are trying to get the value of a named constant, but without knowing anything 
but the name you can't be certain if you know what to do with that data 
constant in the first place (which is why the aforementioned function returns a 
void* and expects you to know what to do with it further).
--
David Duncan
Apple DTS Animation and Printing

_______________________________________________

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

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

Reply via email to