Core Data and text views confuse the undo manager resulting in infinite undos

Originator:ddribin
Number:rdar://6998112 Date Originated:23-Jun-2009 12:08 PM
Status:Open Resolved:
Product:Mac OS X Product Version:10.5.7/9J61, 10.6/10A380
Classification:Serious Bug Reproducible:Always
 
Summary: 
A text view's undos interacts with Core Data undos confusing the undo manager resulting in it constantly returning YES for -canUndo, even after the undo stack is exhausted.

Steps to Reproduce:
1) Run the attached application.
2) Click the "Add" button to add a person
3) Click in the "Last Name" text view (not the text field)
4) Make some edits
5) Click in the "Last Name" text field
6) Click back into the text view
7) Make some more edits
8) Hit Undo 6 times

Expected Results:
The undo stack should be empty after twice hitting Undo.

Actual Results:
The undo stack is never empty, and you can hit Undo forever.  The same goes for Redo.  You can keep doing Redo, after the redo stack is empty.

Regression:
I've tested on 10.5 (10.5.6/9J61) and 10.6 (10A380).

Notes:
Attached is a sample project (Editor2.tbz).  There is no workaround for this problem, that I know of.


Comments

Attachments

http://files.getdropbox.com/u/27036/Radar/6998112/Editor.tbz2

http://files.getdropbox.com/u/27036/Radar/6998112/Editor2.mov


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!