Re: Eval() ?
Re: Eval() ?
- Subject: Re: Eval() ?
- From: Andrew Farmer <email@hidden>
- Date: Thu, 2 Mar 2006 18:00:54 -0800
On 02 Mar 06, at 11:28, Thierry Passeron wrote:
Hello there,
Is there an Eval() like function in cocoa that would eval a string
and execute it as if it was a code.
like:
id object=NSEval(@"[SomeClass
method1:aparameter :anOtherparameter]" );
would be the same as:
id object=[SomeClass method1:aparameter :anOtherparameter];
Is it possible in Objective-C's Cocoa API ?
Not directly.
Cocoa is a superset of C, which is a compiled language; as such
there's no direct way to compile and run code at runtime. However,
there are ways to construct method calls, so long as that's all
you're doing. It's difficult, however; you may want to try explaining
what you're after to see if there's some more straightforward way of
doing what you're looking for.
Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
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
References: | |
| >Eval() ? (From: Thierry Passeron <email@hidden>) |