I have a NSTextField and I want to set its content if I klick on a button and than set the cursor on this textfield at the end of the text so if someone klicks the button he
You'll want to do something like this:
[[self window] makeFirstResponder:[self yourTextField]];