New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrapping objective c objects from javascript #83
Comments
Well, it's not great, but you can do: require('nodobjc/lib/core').wrapValue(buffer, '@'); Pull requests appreciated to add perhaps a |
First off, thank you so much for the prompt response... and I guess I should apologize because I'm new to objective c (my experience lies mostly in c#, c++ and starting on javascript). this would return an "@"? I'm not exactly sure what that means. Would this take the buffer and cast it as an id? Any thoughts on how i'd use NSView based on that? |
var nsview = ….wrapValue(…);
nsview('setFrameSize', { width: 100, height: 100 }); |
i didn't get terribly far. I just crashes out right when I try to call any functions from nsview, it doesn't even catch the exception. var $ = require ('nodobjc'); ///// |
fixed by making this change... to... var nsview = $C.wrapValue(myView.readPointer(0), '@'); |
Could you share your working code here? i'm trying to do the same thing but chrome window just crash when calling 'setFrameSize' or any other method from nsview object. |
I'm working on an experiment where I'm trying to nest a framework instances in nodobjc in a NSView returned from electron. Is there a way to cast these pointers so that I can use the functions in this object?
var myView = mainWindow.getNativeWindowHandle() //returns pointer to NSView
console.log(myView);
output: Buffer@0x7ff8a2ff6300 c0 2d 06 a5 f8 7f 00 00
The text was updated successfully, but these errors were encountered: