• 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: Looking up a NSString constant at runtime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Looking up a NSString constant at runtime


  • Subject: Re: Looking up a NSString constant at runtime
  • From: Scott Ribe <email@hidden>
  • Date: Mon, 04 Jan 2010 16:39:49 -0700
  • Thread-topic: Looking up a NSString constant at runtime

> What if I'm getting a string passed in that is the name of the constant and
> I want to return the constants string value. Is there a way to do that?

This is C, and just as with variables, the names are not there at runtime.
If you really need to do this, you'll have to build your own lookup table,
possibly using some macro magic to avoid having to type the name twice for
each entry.

--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice


_______________________________________________

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

  • Follow-Ups:
    • Re: Looking up a NSString constant at runtime
      • From: David Alter <email@hidden>
References: 
 >Re: Looking up a NSString constant at runtime (From: David Alter <email@hidden>)

  • Prev by Date: Re: Turn off font hinting?
  • Next by Date: Re: GC memory leak - what is it?
  • Previous by thread: Re: Looking up a NSString constant at runtime
  • Next by thread: Re: Looking up a NSString constant at runtime
  • Index(es):
    • Date
    • Thread