Passing parameters to iOS module function from apps.js

You must Login before you can answer or comment on any questions.

Hi,

I have developed an iOS module but i am having trouble passing a parameter to one of the functions in that module from javascript in apps.js. The function in the module is very simple :

-(id)getVal:(id)value
{
    NSString *aid = [TiUtils stringValue:value];
    NSLog(@"AID :%@", aid); 
    return aid;
}
The call in the javascript file apps.js is something like this :
var dispApp = require('disp.App');
var content = dispApp.getVal("abc");
The problem is that the value received in the iOS module function also contains the quotes and brackets too. The NSLog in the iOS function displays - AID :("abc")

The output i expect is - AID :abc

I have tried a lot of things but not able to pass/receive the parameter in that function properly. Please advise, its urgent.

Thanks.

1 Answer

Figured it out myself.

ENSURE_SINGLE_ARG(value, NSString);
This does it.

Your Answer

Think you can help? Login to answer this question!