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 (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com