• 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: Forcing Core Data to save attribute changed behind its back?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forcing Core Data to save attribute changed behind its back?


  • Subject: Re: Forcing Core Data to save attribute changed behind its back?
  • From: Peter <email@hidden>
  • Date: Tue, 24 Jul 2012 15:31:21 +0200

What do you try to win by changing the attribute bind CD's back?

If you want to take it out of undo you might switch it off temporarily (e.g. [undoManager disableUndoRegistration], or store the undo manager in a local, set the context's undo to nil, and restore it - which may or may not cause trouble depending on whats happening in your object graph. I use GCUndoManager to stay away from such trouble.)

Apart from that there is

- (void)refreshObject:(NSManagedObject *)object mergeChanges:(BOOL)flag

as well as the

- (void)setPrimitiveValue:(id)value forKey:(NSString *)key

methods, depending on what you intend to achieve.

Dunno if these might help.

Am 24.07.2012 um 00:03 schrieb Sean McBride:

> Hi all,
>
> I have a managed object where one of the attributes is quite large and so when I change it, instead of the usual setAttribute:newValue I mutate the object directly.  Of course, Core Data does not know that I've done this.  I'm looking for a way to tell it.  (Otherwise, if the thing is mutated after the document is first saved, Core Data cleverly skips updating this attribute.)
>
> I've tried:
> - setAttribute:sameValue
> - will/didChangeValueForKeyPath: but that's not a sufficient 'kick'
>
> Any other suggestions?
>
> Thanks,
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 email@hidden
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
>
>
> _______________________________________________
>
> 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


___ Peter Hartmann ________

mailto:email@hidden



_______________________________________________

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


References: 
 >Forcing Core Data to save attribute changed behind its back? (From: Sean McBride <email@hidden>)

  • Prev by Date: Re: Forcing Core Data to save attribute changed behind its back?
  • Next by Date: Re: Profound UITableView rendering-performance problem, but only at certain positions?
  • Previous by thread: Re: Forcing Core Data to save attribute changed behind its back?
  • Next by thread: Re: Forcing Core Data to save attribute changed behind its back?
  • Index(es):
    • Date
    • Thread