attempt to index global

26 views
Skip to first unread message

iongion

unread,
Mar 4, 2012, 7:28:02 AM3/4/12
to iPhone Wax
With my own code, or even with code suggested in this snippet:

https://gist.github.com/916626

whenever i try to do:

local stuf = UITabBarController:init()
i get: attempt to index global 'UITabBarController'

local bu = UIButton:buttonWithType(UIButtonTypeCustom)
i get: attempt to index global 'UIButton'

NSArray:init()
i get: attempt to index global 'NSArray'

NSMutableArray:init()
i get: attempt to index global 'NSMutableArray'

all code above is placed inside applicationDidFinishLaunching

It seems it cannot find those classes?
What am I doing wrong ?

iongion

unread,
Mar 4, 2012, 12:45:24 PM3/4/12
to iPhone Wax
The question remains, but I discovered a code equivalent that works:

instead of:

local bu = UIButton:buttonWithType(UIButtonTypeCustom)

one can write:

local bu = wax.class["UIButton"]:buttonWithType(UIButtonTypeCustom)

the same goes for NSArray, NSMutableArray and from what I've seen, for
any type that outputs that error (except I guess, for other external
frameworks, in which case one needs to link with LDFLAGS += -all_load)
Reply all
Reply to author
Forward
0 new messages