In the past, if I passed an object which was not encodeable, for example, an 
NSManagedObject, or a collection containing such an object, to 
-[NSKeyedArchiver archivedDataWithRootObject:], it would raise an exception and 
print a warning to the console.

Now, if I pass it an unencodeable object, it instead happily returns an NSData 
object which will in turn happily return nil when passed to +[NSKeyedUnarchiver 
unarchiveObjectWithData:].  If I pass it a collection containing an 
unencodeable object, it also happily returns an NSData object, but this one, 
when passed to +[NSKeyedUnarchiver unarchiveObjectWithData:], will raise an 
exception complaining the count of objects is less than the count of keys.

Although I haven’t isolated this in a demo project, I think this new behavior 
started either in Yosemite, or with the 10.10 SDK.  There is no mention of it 
in the Yosemite Foundation Release Notes.  The documentation of 
-[NSKeyedArchiver archivedDataWithRootObject:] has never made any mention of 
what happens if you pass it an unencodeable object, so, legally speaking, any 
behavior is “expected” :(

Jerry


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to