Hi,
I was chasing this odd behaviour down where I have no problems (zero) if I have widget=require(“widget”) in my code… but when I remove this line, I get a strange behaviour on table contents going pear shaped. In this case where normally self.parent would be a Display Group, but as soon as I remove the require(“widget”) I get this issue
bad argument #-1 to ‘newGroup’ (Proxy expected, got nil)
where self.parent is now nil ???
I’ve narrowed it down to needing this set of Lua code… but I can’t see what it does, but if I remove it, my app blows up because the table object won’t keep the parent display object group in self.parent - why the !?@#?? not ???
So, instead of including require(“widget”), I can add just this bit of code and all seems fine…
local cached_displayNewGroup = display.newGroup
function display.newGroup()
return cached_displayNewGroup()
end
I’m not even sure what this does that makes it happy, and why Corona would need it (or what significance the Lua code has on keeping the type in a table).
I’m using middleclass for some oop, and perhaps that is part of the issue or problem - I’m guessing it is.
Any thoughts?