bug in CCLabelTTF::setString

below piece of code will be crash in android version.

CCabelTTF label;
label.setString("\n\n\n");

So

private static String[] splitString(String content, int maxHeight, int maxWidth, 
            Paint paint){
        String[] lines = content.split("\\n");
        String[] ret = null;
        FontMetricsInt fm = paint.getFontMetricsInt();
        int heightPerLine = (int)Math.ceil(fm.descent - fm.ascent);
        int maxLines = maxHeight / heightPerLine;

        if(lines==null || lines.length == 0)
        {
            lines = new String[1];
            lines[0] = new String(" ");
            return lines;
        }

        ...
}

Mark it. I’ll trace it after my supper, haha

I reproduced it. Bug #624 created. Thanks for your report :slight_smile:

Hi, BigFan, the bug is resolved in this changeset http://www.cocos2d-x.org/projects/cocos2d-x/repository/revisions/698551eb8963730ca6f656cd631e93e91dd6235c
Please try again :slight_smile: