Prior to outsourcing, FB, GP, AppStore, and so on, Lua calls the class is so defined:
Local Platform_appstore = Class ("Platform_appstore", function ()
Return Display.newlayer ()
End
It's a very common usage, but it makes 2 very difficult to debug bugs, which brings a lot of pain to later work.
Bug1:ios Real Machine debugging, AppStore payment, after the mess interface a pass, flash back, Xcode error card in OC file Touchbegan.
The difficulty with this bug is that it is impossible to locate a LUA-layer Error statement, which can only be determined as touch-related error based on OC error.
Cause: Because the Platform_appstore class is a base class that is integrated from Ccobject, the payment is created once, presumably because (without checking the cause) The pay is automatically recycled at a certain point in time, resulting in a touch confusion error.
BUG2: After outsourcing the SDK, do a platform_test class test
Self:createbutton ("Googleplay_pay", CC.P (Display.cx, display.cy-100), function ()
Local GP = Platform_googleplay.new ()
Gp:pay ()
End
-- Local GP = Platform_googleplay.new ()
-- gp:createmenu_googleplay (self)
-- gp:addto (self)
The following is annotated to outsource the original written test, instead of the above code should be the same, but can not call GP.
Cause: The same is because Platform_googleplay is integrated from the Cclayer, and there is no retain after creation, so the next frame is automatically recycled.
Workaround: Change to create class directly.
Local Platform_appstore = Class ("Platform_appstore")
"Texas Hold ' Em development record" in the Lua Layer SDK interface class inherits from the Cocos2d class harm