• 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: crashes loading saved file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: crashes loading saved file


  • Subject: Re: crashes loading saved file
  • From: James Maxwell <email@hidden>
  • Date: Tue, 29 May 2012 00:32:17 -0700

>
> That sounds like it could be a big clue, to me.
>
> encodeConditionalObject only encodes  the object reference if it has been seen by the archiver already. If it hasn't, nil is encoded. So if things are breaking when you use it, it means that parts of the object graph you think you encoded were not.
>
> It's pretty useful for archiving backpointers (though I agree that recreating these rather than archiving them is probably safer).
>
> Assuming that your graph has a root node, archiving from root to leaves should be OK, but you should use encodeConditionalObject for any object you think you should have already archived (like parent nodes).
>
> Another issue could be that if you are storing your parent and child nodes in an array, you probably have pretty solid retain cycles all over the place. Backpointers should almost always be weak (nonretained) references, which calls for special treatment if you want to put them in an array (use [NSPointerArray pointerArrayWithWeakObjects]).


Thanks, Graham. This is a good thought. I've not heard of NSPointerArray before… I'll look into it. It sounds like exactly the kind of structure I should be using.

J.
_______________________________________________

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: 
 >crashes loading saved file (From: James Maxwell <email@hidden>)
 >Re: crashes loading saved file (From: Fritz Anderson <email@hidden>)
 >Re: crashes loading saved file (From: James Maxwell <email@hidden>)
 >Re: crashes loading saved file (From: Roland King <email@hidden>)
 >Re: crashes loading saved file (From: James Maxwell <email@hidden>)
 >Re: crashes loading saved file (From: James Maxwell <email@hidden>)
 >Re: crashes loading saved file (From: Quincey Morris <email@hidden>)
 >Re: crashes loading saved file (From: James Maxwell <email@hidden>)
 >Re: crashes loading saved file (From: Quincey Morris <email@hidden>)
 >Re: crashes loading saved file (From: James Maxwell <email@hidden>)
 >Re: crashes loading saved file (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: crashes loading saved file
  • Next by Date: Re: crashes loading saved file
  • Previous by thread: Re: crashes loading saved file
  • Next by thread: Re: crashes loading saved file
  • Index(es):
    • Date
    • Thread