• 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: Close box not showing as dirty when the doc says it's dirty
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Close box not showing as dirty when the doc says it's dirty


  • Subject: Re: Close box not showing as dirty when the doc says it's dirty
  • From: Lee Ann Rucker <email@hidden>
  • Date: Tue, 05 Feb 2013 17:09:54 -0800

On Feb 5, 2013, at 3:08 PM, Steve Mills wrote:

> On Feb 5, 2013, at 15:12:43, Markus Spoettl <email@hidden> wrote:
>
>> I don't think it's meant to be overridden that way because the framework doesn't realize that the state has changed. You should probably call -setDocumentEdited: instead, or, as an alternative, implement undo and use an NSUndoManager which manages this stuff for you.
>
> From the docs for setDocumentEdited:
>
> "The window controller uses this flag to control whether its associated window shows up as dirty. You should not call this method directly for window controllers with an associated document; the document calls this method on its window controllers as needed."
>
> As far as undo goes, we have our own cross-platform undo system and menu items, so I don't see us implementing Cocoa's undo on top of that, and we shouldn't be expected to. This is supposed to be what isDocumentEdited is for. I'm not sure why it's not working for some cases.
>
> -

There's probably a KVO observer on isDocumentEdited; if nothing triggers setDocumentEdited then it doesn't know to check it.

updateChangeCount: says

If you are implementing undo and redo in an application, you should increment the change count every time you create an undo group and decrement the change count when an undo or redo operation is performed.
Note that if you are using the NSDocument default undo/redo features, setting the document’s edited status by updating the change count happens automatically. You only need to invoke this method when you are not using these features.
_______________________________________________

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


  • Follow-Ups:
    • Re: Close box not showing as dirty when the doc says it's dirty
      • From: Steve Mills <email@hidden>
    • Re: Close box not showing as dirty when the doc says it's dirty
      • From: Steve Mills <email@hidden>
References: 
 >Close box not showing as dirty when the doc says it's dirty (From: Steve Mills <email@hidden>)
 >Re: Close box not showing as dirty when the doc says it's dirty (From: Markus Spoettl <email@hidden>)
 >Re: Close box not showing as dirty when the doc says it's dirty (From: Steve Mills <email@hidden>)

  • Prev by Date: Strange Problem Printing Multiple NSTextViews
  • Next by Date: Re: What's the difference between [NSOperationQueue currentQueue] and performSelectorOnMainThread (iOS platform)
  • Previous by thread: Re: Close box not showing as dirty when the doc says it's dirty
  • Next by thread: Re: Close box not showing as dirty when the doc says it's dirty
  • Index(es):
    • Date
    • Thread