"Texas Hold ' Em development record" in the Lua Layer SDK interface class inherits from the Cocos2d class harm

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.