• 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: Solved? Cocoa/Java - NSCoding woes...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Solved? Cocoa/Java - NSCoding woes...


  • Subject: Re: Solved? Cocoa/Java - NSCoding woes...
  • From: publiclook <email@hidden>
  • Date: Fri, 28 Feb 2003 22:30:57 -0500

It is necessary to retain objects that are unarchived. The NSUnarchiver retains the objects it unarchives, but when the unarchiver itself is deallocated, it releases all of the objects it has retained. If the unarchiver was the only object retaining an unarchived object, the unarchived object will also be deallocated when the unarchiver releases it.

I don't know how the Java bridge works, but if unarchived objects are not retained by the bridge and they are not retained explicitly then they will be deallocated when the unarchiver is deallocated and you will get signal 10 or 11 when the deallocated objects are accessed.

You made your errors go away by not letting the unarchiver be deallocated so it continues to retain the unarchived objects. The better solution is to retain the unarchived objects that you want to keep and let the unarchiver be deallocated normally. That will probably free up lots of temporary objects and other clutter too.

On Friday, February 28, 2003, at 06:27 PM, Rams wrote:

I believe I have discovered the source of my signal 6, 10, and 11's. It looks like I've been bitten by the GC goblin, however the object that is causing the trouble puzzles me a bit. Keeping a reference to the NSUnarchiver does away with the mysterious errors, but why it is causing a problem in the first place mystifies me a bit. By the time it crashes the app, I would assume that I had long been done with the thing but this doesn't appear to be the case. Is there some closure method that I should be calling after unarchiving an object?


--

There are only 10 kinds of people in this world... those who understand binary and those who don't
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Solved? Cocoa/Java - NSCoding woes... (From: Rams <email@hidden>)

  • Prev by Date: Re: [Newbie] writing plain text to a file
  • Next by Date: New Apple sample code - Custom Control
  • Previous by thread: Solved? Cocoa/Java - NSCoding woes...
  • Next by thread: New Apple sample code - Custom Control
  • Index(es):
    • Date
    • Thread