• 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: Intercepting deletion of NSManagedObjects or how to handle deletion in non-explicit relationships?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Intercepting deletion of NSManagedObjects or how to handle deletion in non-explicit relationships?


  • Subject: Re: Intercepting deletion of NSManagedObjects or how to handle deletion in non-explicit relationships?
  • From: Kyle Sluder <email@hidden>
  • Date: Fri, 30 Jul 2010 21:54:37 -0700

On Fri, Jul 30, 2010 at 7:37 PM, Martin Stanley
<email@hidden> wrote:
> Perhaps you know something about NSPredicateEditor that I don't, but I think it does not use its delegate in the way you envision. To quote from the docs:

You are correct. I was thinking of NSRuleEditor.

> However, my subclass of NSPredicateEditor overrides the objectValue method (to catch errors such as the one I described earlier). It would be possible to parse the predicate and create back-pointers at this point. This is called every time the predicate is changed. Would this be a better approach?

Yes, I would expect that whatever controller is setting and retrieving
the objectValue from the predicate editor would be doing the necessary
communication with the model to keep the view and model in a
consistent state. The best thing to do might be to use this
opportunity to convert from NSPredicate instances (for the predicate
editor's objectValue) to collections of managed objects that model the
predicate. Then Core Data delete rules and validation will take care
of all the consistency, rather than forcing this logic into the
controller or view.

--Kyle Sluder
_______________________________________________

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

  • Follow-Ups:
    • Re: Intercepting deletion of NSManagedObjects or how to handle deletion in non-explicit relationships?
      • From: Martin Stanley <email@hidden>
References: 
 >Re: Cocoa-dev Digest, Vol 7, Issue 777 (From: Martin Stanley <email@hidden>)
 >Re: Cocoa-dev Digest, Vol 7, Issue 777 (From: Keary Suska <email@hidden>)
 >Re: Intercepting deletion of NSManagedObjects or how to handle deletion in non-explicit relationships? (From: Martin Stanley <email@hidden>)
 >Re: Intercepting deletion of NSManagedObjects or how to handle deletion in non-explicit relationships? (From: Kyle Sluder <email@hidden>)
 >Re: Intercepting deletion of NSManagedObjects or how to handle deletion in non-explicit relationships? (From: Martin Stanley <email@hidden>)

  • Prev by Date: Re: Determine encoding of file
  • Next by Date: Search Kit memory management
  • Previous by thread: Re: Intercepting deletion of NSManagedObjects or how to handle deletion in non-explicit relationships?
  • Next by thread: Re: Intercepting deletion of NSManagedObjects or how to handle deletion in non-explicit relationships?
  • Index(es):
    • Date
    • Thread