• 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: Delete empty Core Data entities from to-many relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delete empty Core Data entities from to-many relationship


  • Subject: Re: Delete empty Core Data entities from to-many relationship
  • From: Jerry Krinock <email@hidden>
  • Date: Sat, 14 Feb 2015 11:40:11 -0800

> On 2015 Feb 13, at 11:27, Steve Mills <email@hidden> wrote:
>
> Is there a better strategy for deleting empty container entities? At first I tried setting the Asset's folder relationship to Cascade, but that threw up all over.

Apparently the “count is never 1” because Core Data does not delete your Folder until the end of the run loop cycle.

A different approach would be maybe to register for NSObjectsChangedInManagingContextNotification.  Another alternative would be to use the Cascade Delete, and I’m not sure if you’ve done that because I didn’t scrutinize all the details in your post.  But that may not work as expected, as I learned in 2009…

http://lists.apple.com/archives/cocoa-dev/2009/Jun/msg01334.html

A shortcut I’ve learned is: Don't overthink Core Data.  If something doesn’t work as expected, accept it and try something different.


_______________________________________________

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: 
 >Delete empty Core Data entities from to-many relationship (From: Steve Mills <email@hidden>)

  • Prev by Date: Re: WKWebView + <input type="file">
  • Next by Date: Draw key equivs for fkeys?
  • Previous by thread: Delete empty Core Data entities from to-many relationship
  • Next by thread: WKWebView + <input type="file">
  • Index(es):
    • Date
    • Thread