0

i have implement a view confroming UITextInput protocol,(my view is not a class of UITextview or UITextfield)

and how can i get the cursor's position to comunicate with the keyboard?

thanks , guys~

PengOne
  • 48,188
  • 17
  • 130
  • 149
user885506
  • 41
  • 3

1 Answers1

0

I recommend you check out A Guided Tour of a UITextInput Implementation from the docs. There is sample code which shows how to do this: in -setSelectedTextRange: you can update the cursor position using the selected text range.

jtbandes
  • 115,675
  • 35
  • 233
  • 266
  • this function is to set cursor to a speicial position? i want just know the cursor position – user885506 Aug 15 '11 at 03:54
  • No, I think you implement this method and it gets called automatically. However I haven't done this myself; you'll just have to try it. – jtbandes Aug 15 '11 at 04:50