Set cursor at end of textfield in Xcode
-
I have a textfield that may not be able to display its entire contents. When this happens, I'd like to display the right-most contents instead of the left-most contents. Effectively this means I want to set the cursor in the textfield at the right-most position so the contents automatically move in. How can I do this? Thanks!
-
Answer:
NSRange range = NSMakeRange([[textView string] length], 0); [textView setSelectedRange: range]; I'm assuming on OS X because of the tag. Look to http://borkware.com/quickies/one?topic=NSTextView.
simon.d at Stack Overflow Visit the source
Related Q & A:
- How to re-open xCode Archive?Best solution by stackoverflow.com
- How to use NSzombie in xcode?Best solution by Stack Overflow
- How to Link Another Static Library to my Static Library in XCode?Best solution by Stack Overflow
- How to generate xcode project through terminal?Best solution by Stack Overflow
- Are cursor.size() and cursor.count(true) equivalent?Best solution by stackoverflow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.