我使用以下方法UITextFieldDelegate:值類型「字符串」的不具有成員「characterAtIndex」
func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange,
replacementString string: String) -> Bool {
和得到的錯誤消息試圖訪問的第一個字符上面時:
let firstChar = string.characterAtIndex(0)
我不知道有什麼不對的代碼,因爲NSString類引用列出的功能:
func characterAtIndex(_ index: Int) -> unichar
你知道我在做什麼錯嗎?
謝謝您的快速響應! – blueball