Re: Evaluating an NSString to a symbol at runtime...
Re: Evaluating an NSString to a symbol at runtime...
- Subject: Re: Evaluating an NSString to a symbol at runtime...
- From: "Finlay Dobbie" <email@hidden>
- Date: Mon, 18 Sep 2006 20:52:41 -0400
On 18/09/06, Mailing list subscriptions <email@hidden> wrote:
El 18/09/2006, a las 22:45, email@hidden escribió:
> 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?
man NSModule
Or for a higher level, CFBundle.
-- Finlay
_______________________________________________
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