Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can webkit return a C++ object to JavaScript?




On 31.12.2007, at 23:17, Darin Adler wrote:

Can I return a C++ object instead of an objective-c object to javascript? If so, how will the implementation be different?

You can use the C binding API for JavaScript; it's more powerful complete than the Objective-C bridge. You'll need to create the object using the functions from the <JavaScriptCore/JSObjectRef.h> header.


Unfortunately there's no way to return a JSObjectRef from an Objective-C method, so the function that returns this object will need to be implemented using the JavaScriptCore API. I think that in practice this means that you need to convert the entire object you are exporting to JavaScript to the new scheme, even if your need is only for one return value in one function.

That's something I have (pretty close to the bottom) of my ToDo list. Is there any sample available for the bridging functionality?


TIA,
	Tom_E
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.