Question: Anyone have the problem with Undo operation (Cmd + Z) in Xcode?
When I am edit my Objective-C code with Undo operation, some symbols are not correctly edited.
For instance:
was {   

with Undo {{   

XCode 4.2.1

Answer: 
I have Xcode 4.3.2, which still has severe problems with undo/redo -- it will usually crash after one or two redo! Just before it crashes, it will usually do some nonsense edit.

---

*Added*:

I have experimented with the tip by Walt to turn off line numbers. However, I have not seen any significant drop in crash frequency. However, going slowly seems to at least reduce the crash frequency, but it is absolutely no guarantee -- it may crash even after an extremely simply small undo.

(I usually get anywhere from 1 to a dozen crashes a day, but since I try to avoid undo, especially several consecutive undo, the crash frequency has dropped somewhat.)

A crash may come on either undo or redo, with a slightly higher crash frequency for redo. Sometimes the crash comes after just a simple paste with no preceding undo/redo.

I have also experimented with changing font scheme to a very simple one, but it does not help.

My only tip would be: when you see that e.g a paste, or entered text, is inserted at the wrong place, try to save (or ignore that step), then chose Revert Document. Sometimes that trick works, sometimes not (and if not, it will crash). Sometimes it has helped by switching to another file and then back.

Also, if you want to undo just to inspect what the previous thing was, save before the undo, then, rather than redo, it may be slightly safer to Revert Document (but it is by no means any guarantee).

After a refactor, the window's fonts often look garbled. In this case, it has always helped to switch to another file and then back.

Hmm, is this Apple Quality? Steve's adherence to perfection?
Go slowly when using Undo/Redo. I've noticed that it crashes more when I'm hitting Command-Z many times quickly. 

Try turning off the line numbers in Xcode preferences. That seems to have improved things on my Mac. 

Preferences -> "Text Editing" tab -> "Editing" subtab
 uncheck the "Line Numbers" button

From the look of the crash logs, it may be some kind of combination of undoing/redoing (editing) causing the view to scroll or the layout to change dramatically.

From my crash logs:

UNCAUGHT EXCEPTION (NSInternalInconsistencyException): -[DVTLayoutManager \_fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] *\** attempted layout while textStorage is editing. It is not valid to cause the layoutManager to do layout while the textStorage is editing (ie the textStorage has been sent a beginEditing message without a matching endEditing.)