• 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: CoreData: Using willSave to update timestamps causes hang?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData: Using willSave to update timestamps causes hang?


  • Subject: Re: CoreData: Using willSave to update timestamps causes hang?
  • From: mmalcolm crawford <email@hidden>
  • Date: Mon, 2 May 2005 09:21:23 -0700


On May 2, 2005, at 8:37 AM, Jim Correia wrote:
- (void)willSave
Invoked automatically by the Core Data framework when the receiver’s
managed object context is saved. It is commonly used to compute
persisted values from other transient values, to set timestamps, and so
on. This method can have “side effects” on the persistent values.
When I use this to do that exactly - modify the last saved timestamp of an object, I get a hang when saving. It appears that making the change inside of willSave causes willSave to be called again.
- (void)willSave
{
[self setValue: [NSDate date] forKey: @"lastSavedDate"];
}



- (void)willSave { [self setPrimitiveValue: [NSDate date] forKey: @"lastSavedDate"]; }

(Otherwise you're sending additional change notifications during the save process.)

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


  • Follow-Ups:
    • Re: CoreData: Using willSave to update timestamps causes hang?
      • From: Jim Correia <email@hidden>
References: 
 >CoreData: Using willSave to update timestamps causes hang? (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: Tiger gcc 4 builds apps that don't run on 10.2.8
  • Next by Date: Re: Core Data and WebObjects 5.2.3
  • Previous by thread: CoreData: Using willSave to update timestamps causes hang?
  • Next by thread: Re: CoreData: Using willSave to update timestamps causes hang?
  • Index(es):
    • Date
    • Thread