referring to FlurryAPI (or any static .a) in wax?

31 views
Skip to first unread message

Ryan

unread,
Apr 8, 2010, 6:59:40 PM4/8/10
to iPhone Wax

Hmm, what's the easiest way to refer to FlurryAPI (or any static lib's
objects) from Wax?

I added libFlurry.a and FlurryAPI.h to my project, I do an import
"FlurryAPI.h" in main.m, but still can't refer to FlurryAPI in my .lua
file:

function applicationDidFinishLaunching(self, application)
FlurryAPI:startSession("<key>")
-- ...
end

PANIC: unprotected error in call to Lua API (Error calling
'applicationDidFinishLaunching:' on lua object '<AppDelegate:
0x135250>'
data/scripts/AppDelegate.lua:7: attempt to index global 'FlurryAPI' (a
nil value)
stack traceback:
[C]: ?
data/scripts/AppDelegate.lua:7: in function <data/scripts/
AppDelegate.lua:5>)


--
Subscription settings: http://groups.google.com/group/iphonewax/subscribe?hl=en

Ryan

unread,
Apr 8, 2010, 8:51:53 PM4/8/10
to iPhone Wax

N/m, answered my own question:

wax.class["FlurryAPI"]:startSession("...")

However, for that to work, I had to call a Flurry method inside
main.m:

int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

wax_startWithExtensions(luaopen_wax_http, luaopen_wax_json,
luaopen_wax_xml, nil);

[FlurryAPI setUserID: @"Test" ];

int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
[pool release];
return retVal;
}

Without that line, wax.class["FlurryAPI"] returned nil. My guess is
it's because FlurryAPI only contains static methods.. ?

Ryan

Reply all
Reply to author
Forward
0 new messages