How to detect an uninitialized NSMutableArray produced by NSKeyedUnarchiver.unarchiveObjectWithData

Using NSDocument.readFromData and NSKeyedUnarchiver.unarchiveObjectWithData, I retrieve an object (of type A) with a property of type NSMutableArray. That array contains a nested chain of objects of type A. The problem object is a child of a child... in that array. I try to do Count on that array and I get an error.

Can you post some code snippets that show what you're actually doing inside type A?

Note that if you have a chain of references to other A instances, you might see some of them after they're allocated, but before they're fully initialized. You will need to be very careful about what members (properties, functions) of A you use while the unarchiving is still in progress.

How to detect an uninitialized NSMutableArray produced by NSKeyedUnarchiver.unarchiveObjectWithData
 
 
Q