• 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
Core Data: Begin+End Undo Group = Dirty Dot. Why?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data: Begin+End Undo Group = Dirty Dot. Why?


  • Subject: Core Data: Begin+End Undo Group = Dirty Dot. Why?
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 13 Nov 2009 18:53:56 -0800

I have discovered (one of?) the mysterious causes of a Core Data document becoming "dirty" (red button in title bar gets black dot) when no changes have been made to the store.

STEPS TO REPRODUCE:

* Mac OS 10.5.8 (haven't tested 10.6 yet)
* Download a fresh copy of Apple's DepartmentAndEmployees sample project.
* Add this method implementation to the MyDocument class:


- (IBAction)dooDoo:(id)sender {
    [[self undoManager] beginUndoGrouping] ;
    [[self undoManager] endUndoGrouping] ;
}

* Declare dooDoo: in MyDocument.m
* Save all files.
* Open MyDocument.nib.
* Add a button in the window, title "DooDoo".
* Connect button to target MyDocument, action dooDoo:.
* Build and run.  A new document appears.  Its dirty dot is clean.
* Click the "Doodoo" button.

EXPECTED RESULT:

Nothing should happen.

ACTUAL RESULT:

The dirty dot becomes dirty.

Why would the dirty dot become dirty when no change was made to the store? I don't see any logical reason for this.

In my real app, I often manually begin and end a "super undo group". However, I don't know before it starts if any changes will be made to the store. So, in order to avoid these false dirties, the only workaround I can think of is to manually track changes (which, fortunately, I'm already doing for other reasons), and later send a - clearAllChanges if no changes occurred. Is there a less kludgey workaround?

Thanks,

Jerry Krinock

_______________________________________________

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: Core Data: Begin+End Undo Group = Dirty Dot. Why?
      • From: Graham Cox <email@hidden>
    • Re: Core Data: Begin+End Undo Group = Dirty Dot. Why?
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Bindings vs MOC change notification
  • Next by Date: Re: Core Data: Begin+End Undo Group = Dirty Dot. Why?
  • Previous by thread: Re: Bindings vs MOC change notification
  • Next by thread: Re: Core Data: Begin+End Undo Group = Dirty Dot. Why?
  • Index(es):
    • Date
    • Thread