檢測空UITextField中的Backspace是否有任何方法可以檢測到背空間/刪除鍵按在iphone鍵盤上UITextField那是空的?我想知道什么時候背空間只在以下情況下才按下UITextField是空的。根據@AlexReynolds在評論中的建議,我在創建文本字段時添加了以下代碼:[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleTextFieldChanged:)
name:UITextFieldTextDidChangeNotification
object:searchTextField];收到此通知(handleTextFieldChanged函數),但當我按下背空間輸入一個空字段。有什么想法嗎?這個問題似乎有些混亂。控件時,我希望收到通知。背空間按下鍵。就這樣。但是解決方案也必須在UITextField已經空了。
3 回答

湖上湖
TA貢獻2003條經驗 獲得超2個贊
-[UITextField deleteBackward]
.
UITextInput
UIKeyInput
deleteBackward
UILabel
UIKeyInput
UITextInput
UIKeyInput
- 3 回答
- 0 關注
- 576 瀏覽
添加回答
舉報
0/150
提交
取消