Coco2d 2.1 and Xcode 7 iOS 9 crash ccShader

前端 未结 4 1114
离开以前
离开以前 2020-12-25 15:23

I tested Xcode 7 with but my cocos2d 2.1 games crash on simulator or on devices:

ccShader_PositionColorLenghtTexture_frag.h

2015-06-15 22:36:13.319 N         


        
4条回答
  •  余生分开走
    2020-12-25 15:38

    NOTE: Wanted to write this as a comment but don't have enough reputation to write a comment, hence writing this as an answer:

    The fix described by Reid does fix the issue. However it crashes on iOS 7 devices, because it uses containsString method which is only available in iOS 8 and above

    A simple change to the following line fixes the issue:

    if([sourceStr containsString:g_extensionStr]) {
    

    needs to be changed to:

    NSRange range = [sourceStr rangeOfString:g_extensionStr];
    if(range.length > 0) {
    

提交回复
热议问题