Closed
Description
I added a method to my TeapotController
object:
- (void)touchHappened {
RCT_EXPORT();
NSLog(@"happened");
CC3Vector pos = teapotNode_.position;
[teapotNode_ setSizeX: 10];
[teapotNode_ invalidateGlobalTransformMatrix];
}
Looking through the source, it looks like I can add RCT_EXPORT
to export a method. I can then call it like this:
var controller = require('NativeModules').TeapotController;
controller.touchHappened();
If I just log something in touchHappened
, this works. But when I try to access an instance variable like teapotNode_
, nothing happens... but I don't see how this works anyway. How is it exporting a method from an instance? What I have multiple instances of TeapotController
? I don't see how I could require individual instances.