• 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: Sending messages without knowing number of args and types at compile time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sending messages without knowing number of args and types at compile time


  • Subject: Re: Sending messages without knowing number of args and types at compile time
  • From: Per Bull Holmen <email@hidden>
  • Date: Tue, 2 Feb 2010 00:21:01 -0800 (PST)

Greg Parker wrote:
> On Feb 1, 2010, at 3:30 AM, Per Bull Holmen wrote:
> > I've been playing around with the idea of making a simple bridge
> > between Objective-C (running under Cocoa) and a script language.

/.../

> > I'd like to know whether there are any other ways than
> > NSInvocation to send a message without knowing arg types and numbers
> > at compile time. Non-hackish ways, that is.

> NSInvocation is the most architecture-neutral way to go.
>
> The best option outside NSInvocation is to use libffi to build calls
> to objc_msgSend.

Thanks. I forgot to mention one thing: It need not be perfect! Far from it... :) Just a simple tool, to facilitate letting a script (Lua) control a Cocoa application. Therefore, I just might go for making a few quick implementations for common argument- and return type combinations, and use NSInvocation for everything else. Then the user can install their own quick handlers for combinations that aren't covered yet.

But libffi seems like a very interesting option. Michael Ash mentions PyObjC and RubyCocoa, a quick check reveals that they both use libffi. Any further questions regarding this will be sendt on the objc mailing list. Thanks!

Per
_______________________________________________

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: Sending messages without knowing number of args and types at compile time
      • From: Jens Alfke <email@hidden>
References: 
 >Sending messages without knowing number of args and types at compile time (From: Per Bull Holmen <email@hidden>)
 >Re: Sending messages without knowing number of args and types at compile time (From: Greg Parker <email@hidden>)

  • Prev by Date: Re: Returning a nil float?
  • Next by Date: RegisterEventHotKey and keylogging
  • Previous by thread: Re: Sending messages without knowing number of args and types at compile time
  • Next by thread: Re: Sending messages without knowing number of args and types at compile time
  • Index(es):
    • Date
    • Thread