NSTextView CoreData binding and UndoManager
NSTextView CoreData binding and UndoManager
- Subject: NSTextView CoreData binding and UndoManager
- From: Keith Wilson <email@hidden>
- Date: Mon, 12 Nov 2007 23:15:19 +1100
Hi,
I have an NSTextView that is bound to an NSString in Core Data.
The NSTextView is contained an NSScrollView which is contained in an
NSTabView.
I have set [NSUndoManager setLevelsOfUndo:20]
In Interface Builder I have checked allows Undo for the NSTextView
I am running on Leopard 10.5 using the Xcode 2.4 option and compiling
for OS X 10.4 (Universal), I tried XCode 3/0 and compiling for 10.5
but it makes no difference.
If I run it on Leopard and make 21 changes to the data in the
NSTextField, with 21 moc saves, I get a crash with the following trace:
Thread 0 Crashed:
0 libobjc.A.dylib 0x948366e4 objc_msgSend + 20
1 com.apple.Foundation 0x95ff644e -[_NSUndoStack markEnd]
+ 110
2 com.apple.CoreFoundation 0x947a8bac -[NSSet
makeObjectsPerformSelector:withObject:] + 188
3 com.apple.Foundation 0x95fd4bd0 +
[NSUndoManager(NSUndoManagerPrivate) _endTopLevelGroupings] + 128
4 com.apple.AppKit 0x931bd71d -[NSApplication run] + 871
5 com.apple.AppKit 0x9318a9ba NSApplicationMain + 574
6 com.<myApplication> 0x00002bce _start + 216
7 com.<myApplication> 0x00002af5 start + 41
The moc saves are activated whenever the user moves the focus to a
field somewhere else in my application of selects a different tab in
the TabView.
If I run the same compiled executable code on OS X 10.4.10 Tiger then
it works fine.
If I change the levels of undo to "n" it will crash after "n"
iterations of change/save of the data in the NSTextView.
If, in Inteface Builder, I turn off the check box for Undo for the
NSTextView and recompile then it works fine on Leopard but, of course,
the user loses the ability to undo whilst using the NSTextView.
In Leopard there seems to be some contention/confusion between
NSTextView's undoManager and Core data's undoManager.
Is this a known problem? Is there a work around?
Keith
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden