Dear list,

I have a puzzling problem which is making my puzzler sore.

Here's the outline:

I have a core-data doc based app. I have core data entities which represent 
files on disk. When the entity is created, the contents of the file are loaded 
(in to a binary-data attribute called 'content'). Now I have an outline view 
which shows the project-tree of files. Double-clicking an item in the 
project-tree (outlineview) adds that NSManagedObject to an NSArrayController 
class (opened files). There is then an NSTextView which is bound to the 
'content' attributed of the currently selected file in the array controller.

So far, so good. Almost everything is working as I expect.

The nasty little problem I have is that if I edit the contents of a file via 
the NSTextView, then do 'undo', the cursor (selection) in the NSTextView jumps 
to the end of the document, and the scrollview jumps to the top. Almost as if 
the whole text has been replaced. The only way I can avoid this so far is to 
set the binding so that it doesn't 'update continuously'. One other symptom is 
that each undo removes the last character typed, whereas with 'update 
continuously' off I get the more common behaviour of undoing the last word or 
at least recent group of actions.

Does anyone have any insights in to what I might be doing wrong? I tried with a 
toy project and I'm getting the same results. 

Best wishes,

Martin



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer 
    Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: martin.hewit...@aei.mpg.de
WWW: http://www.aei.mpg.de/~hewitson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to