Re: Debugging insight needed for NSKeyedUnarchiver
Re: Debugging insight needed for NSKeyedUnarchiver
- Subject: Re: Debugging insight needed for NSKeyedUnarchiver
- From: email@hidden
- Date: Sun, 02 Mar 2014 20:36:03 +0000
On 27 Feb 2014, at 01:11, Graham Cox <email@hidden> wrote:
> I've got a weird bug I'm having a hard time tracking down.
>
> In an archive, I have an array of objects. In an earlier version of my app, these are dearchived fine. In a recent build, they do not. The array is returned, but it contains 0 objects. Using a delegate on the unarchiver, I can see that the objects that this array should contain are in fact dearchived, but for some reason which I can't examine (due to it being internal to NSKeyedUnarchiver) they never end up in the array. This only occurs in one particular instance - the archive is large and otherwise decodes fine. The particular line that decodes the array is executed many times in the course of decoding the whole archive.
>
> Given that this worked previously and no longer does, I'm quite prepared to believe that I introduced a bug, but it's very unclear how it could affect the internals of NSKeyedUnarchiver (memory clobbering?).
>
> Can anyone suggest a way I could debug this? Note that no exceptions are thrown at any point.
If facing this I would:
1. In unarchiver:didDecodeObject: return a proxy object for inclusion in the archive. Doing this in a class wise fashion might help pinpoint a problematic class or instance.
2. in unarchiver:didDecodeObject: - if possible write a validation/internal consistency method for the decoded objects (may be infeasible if the class fauna is large but 1. may have provided some pointers).
Jonathan
_______________________________________________
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