• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Suggest reasons for this crash?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggest reasons for this crash?


  • Subject: Re: Suggest reasons for this crash?
  • From: Graham Cox <email@hidden>
  • Date: Wed, 7 Oct 2009 15:55:13 +1100


On 07/10/2009, at 3:37 PM, Kyle Sluder wrote:

I can't imagine the
usefulness of replacing the contents of the text storage instead of
just swapping in the new one.


I do this because previously I was replacing the text storage and that was causing a huge amount of upset for Undo, producing a crash deep inside the undo manager for a private object it maintains. (Essentially, the target for a text editing undo operation is the text storage, so if it's replaced the reference is stale, since Undo tasks do not retain their targets). In fact I recall that it was you who suggested that using -replaceTextStorage: would cause problems for Undo and suggested replacing the content instead. Indeed, that did seem to eradicate that particular source of problems. I didn't try it but -setTextStorage: would presumably have the same effect on Undo, making it unsafe.

However, there were other problems anyway so I ended up disabling Undo for typing when the text is being edited. I'd like to be able to re- enable it at some point but I can't see a very nice way to consolidate the two "phases" for Undo - typing, then just getting the typed text and setting it back into my data model, which is also undoable. At that point the undos relating to typing should be removed from the undo stack but I can't find a stable way to do that, hence disabling Undo for typing altogether.

http://www.cocoabuilder.com/archive/message/cocoa/2009/9/16/245160

--Graham
_______________________________________________

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


References: 
 >Suggest reasons for this crash? (From: Graham Cox <email@hidden>)
 >Re: Suggest reasons for this crash? (From: Kyle Sluder <email@hidden>)
 >Re: Suggest reasons for this crash? (From: Graham Cox <email@hidden>)
 >Re: Suggest reasons for this crash? (From: Kyle Sluder <email@hidden>)
 >Re: Suggest reasons for this crash? (From: Graham Cox <email@hidden>)
 >Re: Suggest reasons for this crash? (From: "Adam R. Maxwell" <email@hidden>)
 >Re: Suggest reasons for this crash? (From: Kyle Sluder <email@hidden>)
 >Re: Suggest reasons for this crash? (From: "Adam R. Maxwell" <email@hidden>)
 >Re: Suggest reasons for this crash? (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Issues with NSWindowDelegate on multiple Mac OS X platforms
  • Next by Date: Re: Issues with NSWindowDelegate on multiple Mac OS X platforms
  • Previous by thread: Re: Suggest reasons for this crash?
  • Next by thread: "remote" binding problem
  • Index(es):
    • Date
    • Thread