• 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
Evaluating an NSString to a symbol at runtime...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Evaluating an NSString to a symbol at runtime...


  • Subject: Evaluating an NSString to a symbol at runtime...
  • From: email@hidden
  • Date: Mon, 18 Sep 2006 13:45:37 -0700

I have a situation where I have a string passed into my controller where it needs to be evaluated into an extern NSString constant.
As an example, I get the value @"kABPhoneWorkFAXLabel" passed in.


If I do the following:

NSString *stringFromTextField = [textField stringValue]; //(IOW it is @"kABPhoneWorkFAXLabel" )
ABPerson *person = [self getARandomPerson];
[person valueForProperty:stringFromTextField];


It will always of course return nil. Is there a method to evaluate *stringFromTextField to a named constant?
Something like constNamed() function that would evaluate the obj-c symbol and find it?


Thanks for any help.

Andre
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Evaluating an NSString to a symbol at runtime...
      • From: Mailing list subscriptions <email@hidden>
  • Prev by Date: Re: Sliding a view into place?
  • Next by Date: Re: Internal Compiler error: Bus error
  • Previous by thread: Re: Sliding a view into place?
  • Next by thread: Re: Evaluating an NSString to a symbol at runtime...
  • Index(es):
    • Date
    • Thread