I have a NSData which is returned from an ASIHTTPRequest and I want to be able to unarchive this. However some NSData can be unarchived and some can’t.
The issue is how do I figure out which one can and which one can’t? unarchiveObjectWithData will crash if I provide a data that can’t be unarchived.
You are able to archive all custom objects if you specify how it’s supposed to be encoded/decoded. If you are not sure how to do this check out this tutorial: Click Here!
If you are storing basic datatypes, using NSUserDefaults is also viable.