添加UITextField,打字输入会crash,求帮助

做一个聊天框,添加了一个UITextField,打字的时候有不小的几率会crash,请求帮助



不知道为啥,这里添加不了图片,请大家移步到这里

http://cn.cocos2d-x.org/bbs/forum.php?mod=viewthread&tid=10011&extra=page%3D1

Sorry,没看到代码的话不太好判断错误。

麻烦移步到这里看代码:http://stackoverflow.com/questions/13656605/cocos2d-x-for-ios-uitextfield-would-crash-some-times-when-input#comment18780905_13656605

如果有delegate实现代码的话,麻烦也贴出来,这样比较好看一些。

  • (BOOL)textFieldShouldReturn:(UITextField *)textField
    {
    CCLog(“textfield = %d”, textField.tag);
    if (textField.tag == CHAT_TEXT_TAG)
    {
    ChatLayer::instance()->on_send(NULL);
    }
    }

  • (void)textFieldDidEndEditing:(UIT

  • (BOOL)textFieldShouldReturn:(UITextField *)textField
    {
    CCLog(“textfield = %d”, textField.tag);
    if (textField.tag == CHAT_TEXT_TAG)
    {
    ChatLayer::instance()->on_send(NULL);
    }
    }

  • (void)textFieldDidEndEditing:(UIT