• 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: Saving with Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving with Core Data


  • Subject: Re: Saving with Core Data
  • From: mmalcolm crawford <email@hidden>
  • Date: Mon, 20 Jun 2005 13:58:33 -0700


On Jun 20, 2005, at 10:47 AM, Jeff LaMarche wrote:

In a Core Data application, I've got the Save menu item bound to the saveAction: of my application delegate which works. I'd like to have the menu disabled, however, until a change has been made. Is there any way to bind the enabled binding of the menu item to the context or model to do this, or do I have to write code to handle this?

Assuming that you're using the default configuration for a Cocoa Core Data Application, you can bind enabled to [App Delegate].managedObjectContext.hasChanges

In general, if the menu item is connected to First Responder, implement a validateMenuItem: method in your controller. For the saveAction: selector, return the same as whatever the managed object context returns from hasChanges.

mmalc

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Saving with Core Data (From: Jeff LaMarche <email@hidden>)

  • Prev by Date: Re: NSLog doesn't work with OCUnit
  • Next by Date: core data/table column sorting question
  • Previous by thread: Saving with Core Data
  • Next by thread: Figuring out the size of an NSTabViewItem subclass
  • Index(es):
    • Date
    • Thread