Somewhere in my code
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:someArray];
I expect data
to be nil
if someArray
is nil
, but it return some data I don't understand.
I print it out as below
<62706c69 73743030 d4010203 0405080a 0b542474 6f705824 6f626a65 63747358 24766572 73696f6e 59246172 63686976 6572d106 0754726f 6f748000 a1095524 6e756c6c 12000186 a05f100f 4e534b65 79656441 72636869 76657208 11161f28 32353a3c 3e444900 00000000 00010100 00000000 00000c00 00000000 00000000 00000000 00005b>
I tried NSData *data = [NSKeyedArchiver archivedDataWithRootObject:nil];
to make sure the argument is certainly nil.
I read the documentation and cannot find any explanation about this.
So what exactly is happening here?
Edit I write data to file, and it turn out to be a plist like this. It may be the way the NSKeyedArchiver store objects.