• 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: -[NSManagedObjectContext hasChanges] returns 1, yet no visible changes? (was Re: refreshObject:mergeChanges: vs. stale transient properties)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -[NSManagedObjectContext hasChanges] returns 1, yet no visible changes? (was Re: refreshObject:mergeChanges: vs. stale transient properties)


  • Subject: Re: -[NSManagedObjectContext hasChanges] returns 1, yet no visible changes? (was Re: refreshObject:mergeChanges: vs. stale transient properties)
  • From: Jim Correia <email@hidden>
  • Date: Wed, 10 Aug 2005 14:50:21 -0400

On Aug 10, 2005, at 12:34 PM, Jim Correia wrote:

I do notice that after refreshing the managed object context (refreshObject:mergeChanges: passing YES) that the target context is marked dirty - that is hasChanges returns true.

If l look at the context, the insertedObjects are empty, deletedObjects are empty, and updatedObjects contains the Person and the Resume object. If I ask those objects for their changedValues, both return empty dictionaries, yet hasChanges returns true. (Person has a to-one relationship to resume, resume has an inverse. I don't yet have a standalone example that shows the problem.)

http://homepage.mac.com/jimcorreia/tmp/HasChanges.zip

Steps to reproduce using the provided sample:

1.     Build and run.

2.    Create a new person, fill in a value for the resume. Click Save.

3.    Quit, then relaunch.

4.     Edit the value for the resume in window 1. Click Save.

5.     Notice that the secondary context reports that it hasChanges, but
    none of the updatedObjects report changed values.

N.B. I'm usingn YES for mergeChanges so committed but unsaved edits are
kept.




Jim
_______________________________________________
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: 
 >refreshObject:mergeChanges: vs. stale transient properties (From: Jim Correia <email@hidden>)
 >Re: refreshObject:mergeChanges: vs. stale transient properties (From: mmalcolm crawford <email@hidden>)
 >Re: refreshObject:mergeChanges: vs. stale transient properties (From: Jim Correia <email@hidden>)
 >Re: refreshObject:mergeChanges: vs. stale transient properties (From: Jim Correia <email@hidden>)
 >Re: refreshObject:mergeChanges: vs. stale transient properties (From: mmalcolm crawford <email@hidden>)
 >-[NSManagedObjectContext hasChanges] returns 1, yet no visible changes? (was Re: refreshObject:mergeChanges: vs. stale transient properties) (From: Jim Correia <email@hidden>)

  • Prev by Date: Open Recent menu
  • Next by Date: Re: Question about Threading
  • Previous by thread: -[NSManagedObjectContext hasChanges] returns 1, yet no visible changes? (was Re: refreshObject:mergeChanges: vs. stale transient properties)
  • Next by thread: Cocoa and flash
  • Index(es):
    • Date
    • Thread