• 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: Jens Alfke <email@hidden>
  • Date: Mon, 31 May 2010 13:23:15 -0700

On May 31, 2010, at 10:11 AM, Louis-Philippe wrote:

> like, if I have a c++ lib I would like to call from within an Objective-c
> class, assuming a call like:

I’m not sure what it is you’re trying to do. You can easily call C++ code from Objective-C just by switching the compiler dialect to Objective-C++, which is done most simply by changing your source file’s extension from .m to .mm.

If you’re trying to load a dylib dynamically and resolve symbols, use dlopen etc. as Sherm said. To call those functions you’ll need to cast the pointer to the appropriate type of function pointer and call it.

If you’re looking for a general-purpose eval( ) function as found in interpreted languages like PHP or Python, there isn’t one. Objective-C is not an interpreted language, so the parsing and compilation is done at build time by the compiler, not at runtime.

—Jens_______________________________________________

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: eval?
      • From: Louis-Philippe <email@hidden>
References: 
 >eval? (From: Louis-Philippe <email@hidden>)

  • Prev by Date: Re: NSNetService - send data to printer
  • Next by Date: Re: Notification of file system modification arrives too early?
  • Previous by thread: Re: eval?
  • Next by thread: Re: eval?
  • Index(es):
    • Date
    • Thread