• 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: Can't get NSManagedObject subclass to release objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't get NSManagedObject subclass to release objects


  • Subject: Re: Can't get NSManagedObject subclass to release objects
  • From: Dave Fernandes <email@hidden>
  • Date: Fri, 09 Aug 2013 09:53:36 -0400

As Jerry said, you can't force the MOC to release a managed object. However, you CAN force it to turn managed objects into faults. Then in your override of -[NSManagedObject didTurnIntoFault], you can release the transient object. You will have to recreate the transient object on demand if the managed object is faulted back in.

On 2013-08-09, at 8:38 AM, Jerry Krinock <email@hidden> wrote:

>
>
> On 2013 Aug 09, at 00:59, Rick Mann <email@hidden> wrote:
>
>> I've tried calling -refreshObject:mergeChanges: on it, but that only seems to reduce the retain count on my object by one.
>
> I presume that Xcode's Product > Profile > Leaks is available in iOS projects.  You could run it and make sure you don't have a memory leak.
>
>> What I really want is for Core Data to just let my objects go when I'm no longer strongly referencing them.
>
> I vaguely recall that maybe Core Data is not guaranteed to release managed objects until their owning managed object context is deallocced.  You may need to fetch objects you want released in a different, temporary moc.
>
> Anyhow, maybe my wild guesses will inspire someone to jump in and correct me :)
> _______________________________________________
>
> 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


_______________________________________________

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: Can't get NSManagedObject subclass to release objects
      • From: Jerry Krinock <email@hidden>
References: 
 >Can't get NSManagedObject subclass to release objects (From: Rick Mann <email@hidden>)
 >Re: Can't get NSManagedObject subclass to release objects (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: NSToolbar settings not saved
  • Next by Date: Re: Can't get NSManagedObject subclass to release objects
  • Previous by thread: Re: Can't get NSManagedObject subclass to release objects
  • Next by thread: Re: Can't get NSManagedObject subclass to release objects
  • Index(es):
    • Date
    • Thread