I use CoreData for a Mac application which runs under 10.5 and higher. The content of an entity (text attribute) will be displayed in an NSTextView through bindings. The user can edit the text there.
When I try to save the managed object context, the mouse cursor disappears from the text view and the text view scrolls up to the top.
How can I prevent CoreData/binding to do this because it’s annoying for the user to lose the focus!
Edit: Added the solution as a separate answer to mark the question as completed!
I just found a solution for this problem. Before saving the managed object context I save the “state” (selected range and scroll position) of the text view
after saving my entities I restore the selected range and scroll position
I found 2 possible solution to set the scroll position of a scroll view
which does not work for me