Hello people, I had gone through all .m files of ti.paint module but didn't find createPaintView() function in these (you can see here). where to define such methods in our own module ?
when i tried with mine, the error I got was this
[ERROR] Script Error = -[UIView boundBridge:withKrollObject:]: unrecognized selector sent to instance 0xa026280 at moduletest.js (line 10)
the code in .m (other than assets.m)file is(in #pragma Public APIs region)#
#pragma Public APIs -(id)createView:(id)args { UIView *view=[[UIView alloc]initWithFrame:CGRectMake(0,0,320,460)]; [view setBackgroundColor:[UIColor redColor]]; return view; } -(id)example:(id)args { // example method return @"hello world"; }code in moduletest.js is #
var window = Ti.UI.currentWindow; var label = Ti.UI.createLabel(); window.add(label); // TODO: write your module tests here var moduletest = require('ti.moduletest'); Ti.API.info("module is => " + moduletest); var view = moduletest.createView(); window.add(view);Thank You in advance.
1 Answer
Accepted Answer
"create" methods are implemented automatically by titanium when building modules. What you are looking for is a class probably called (TiPaint)PaintView, where the name in parenthesis is the module name, as explained here
Your Answer
Think you can help? Login to answer this question!