ios - How to set selection in UITextView? -


i have uitextview placed inside uitableviewcell. select content inside uitextview, i'll use following code.

[uitextview select:self]; [uitextview setselectedrange:nsmakerange(start,length)]; 

once uitableview loaded, following methods called

  1. numberofrowsinsection:(nsinteger)section
  2. cellforrowatindexpath:(nsindexpath *)indexpath
  3. heightforrowatindexpath:(nsindexpath *)indexpath

my question , should place code uitextview got focused.

thanks answers.

you should put code in viewdidappear method. first, scroll target cell view make visible:

scrolltorowatindexpath:atscrollposition:animated: 

then, cell want direct input:

cellforrowatindexpath: 

now cast cell cell of type, grab uitextview, make selection, , give focus.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -