• 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
Document dirty?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Document dirty?


  • Subject: Document dirty?
  • From: email@hidden
  • Date: Tue, 8 Oct 2002 18:47:50 EDT

Thanks for the info Chris. I see that code can be safely excised.

Now on to what I was really trying to do in the first place (get Cocoa to
review unsaved documents). I realized I actually had to explicitly set the
document dirty flag in each method that changed the document. But it doesn't
seem to be working.

From within a NSDocument subclass:

for(controllersIndex = [theWindowControllers count]-1; controllersIndex >
= 0; controllersIndex--)
{ // Loop through all controllers for this document and set
dirty flag on each window
[[[theWindowControllers objectAtIndex:controllersIndex] window]
setDocumentEdited:YES];
}
// ---------Test to see if doc set dirty
areEditedDocs = [[NSDocumentController sharedDocumentController]
hasEditedDocuments];
// ---------Test to see if doc set dirty

I get 'areEditedDocs' == NO.

-Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: NSView in textured window
  • Next by Date: cString, (deprecated), lossyCString, fileSystemRepresentation, %@
  • Previous by thread: Re: Carbon vs Cocoa arguments
  • Next by thread: cString, (deprecated), lossyCString, fileSystemRepresentation, %@
  • Index(es):
    • Date
    • Thread