0

I have an NSDictionary (which I get from querying in sqlite) which contains bytes. Here is a sample:

Rects = "<62706c69 73743030 d4010203 04050824 25542474 6f705824 6f626a65 63747358 24766572 73696f6e 59246172 63686976...

I want to convert this using the NSKeyedUnarchiver, but what is the right way to do it?

This is what I did:

NSData *data = [rectDict objectForKey:@"Rects"];
NSArray *rectArray = [NSKeyedUnarchiver unarchivedObjectWithData:data];

But this returns NULL. How will I do this?

NOTE: I used NSArray as the unarchiver because the data to be unarchived is an array containing custom objects.

UPDATE: To clarify, the dictionary contains the archived object. The whole dictionary is not archived, just the content. That's what I'm trying to get.

Carelinkz
  • 936
  • 8
  • 27
user1412469
  • 279
  • 5
  • 17
  • possible duplicate of [converting NSDictionary object to NSData object and vice-versa](http://stackoverflow.com/questions/3157356/converting-nsdictionary-object-to-nsdata-object-and-vice-versa) – Parag Bafna Jul 24 '12 at 06:22
  • @ParagBafna can you please explain how come my question is a possible duplicate of that question? I would gladly accept it if it is really a possible duplicate, but I just can't find the solution for that question to be appropriate in my situation. So kindly explain. – user1412469 Jul 24 '12 at 06:46

0 Answers0