gpt4 book ai didi

iphone - 自定义退格按钮导致 iPhone 应用程序崩溃

转载 作者:行者123 更新时间:2023-12-03 20:36:42 25 4
gpt4 key购买 nike

我有一个自定义键盘,每当我第一次触摸退格按钮时,我的应用程序就会崩溃!我该如何解决这个问题?

我的代码:

 myText.text = [myText.text substringToIndex:([myText.text length]-1)];

最佳答案

测试现有文本是否至少有一个字符需要修剪...

if ([myText.text length]>0) myText.text = [myText.text substringToIndex:([myText.text length]-1)];

关于iphone - 自定义退格按钮导致 iPhone 应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2657528/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com