title: How to move caret (cursor) to the end of the line in cocoa
body: <p>This is probably an easy task, but Im new to cocoa, and haven't found the solution yet.</p>
  
  <p>The algorithm I wrote accepts and validates user's input. It accepts only numbers and then takes the input to the acceptable form, which is nn:nn:nn where nn is a two digit number.</p>
  
  <p>The way the algorithm works is following:</p>
  
  <ol>
  <li>accept the digit</li>
  <li>check if we need to insert :</li>
  <li>add to final string</li>
  </ol>
  
  <p>So what happens is that after user typed in 123 in a text field it looks like: 12:|3 (where | is the cursor position)</p>
  
  <p>As you can understand if user types 12345 for example the input will look like: 12:45:|3 which is wrong.</p>
  
  <p>I see the fix for this as just a simple move of the cursor to the end of the line after I do the : insertion. But I can't find the way to do it so far. :(</p>
  
  <p>If anyone can help me to fix this bug, I would really appreciate it!</p>
  
  <p>Thank you!</p>