• 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: Eval() ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Eval() ?


  • Subject: Re: Eval() ?
  • From: "Corey O'Connor" <email@hidden>
  • Date: Thu, 2 Mar 2006 19:09:48 -0800

I also feel obligated to point out that without strict constraints on
what can be eval'd an eval feature is a great way to introduce a
security hole. :-)

-Corey

On 3/2/06, Andrew Farmer <email@hidden> wrote:
> 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.
>
>
>  _______________________________________________
> 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
>
>
>


--
-Corey O'Connor
 _______________________________________________
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>)
 >Re: Eval() ? (From: Andrew Farmer <email@hidden>)

  • Prev by Date: NSButton with modifier key
  • Next by Date: Re: NSButton with modifier key
  • Previous by thread: Re: Eval() ?
  • Next by thread: Re: Eval() ?
  • Index(es):
    • Date
    • Thread