Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (example)
Viewing all articles
Browse latest Browse all 21

Creating a Custom Module - Copy of Example Function is Undefined?

$
0
0

So I am just starting out creating custom modules....however, I am having a hard time understanding why my code is not working. I simply copied the example method in the base module class and named it exampleTwo. As it is in the base module class, I don't see any of the other example methods defined in the .h, like you would in a proxy.

Calling the example method and my own, which gives the error result of expression 'mymodule.exampleTwo' [undefined] is not a function

var mymodule = require("com.lafitness.mymodule");
Ti.API.info('e' + mymodule.example());
Ti.API.info('e' + mymodule.exampleTwo());
The implementation:
#pragma Public APIs
-(id)example:(id)args
{
    // example method
    return @"hello world";
}
 
-(id)exampleTwo:(id)args
{
    return @"hello world2";
}

Viewing all articles
Browse latest Browse all 21

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>