19

Possible Duplicates:
How to convert NSArray to NSData?
Need to convert NSData to NSArray

HI, I have a NSData object named as "myNsData"(it is converted form of NSArray) and a NSarray named as "myNsArray. can any one provide me a code to convert a NSData to NSArray?

Community
  • 1
  • 1
Vipin
  • 4,718
  • 12
  • 54
  • 81

2 Answers2

30

See this post... Convert NSArray to NSData

The last comment deals with the reverse....

NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithData:data]
Community
  • 1
  • 1
Simon Lee
  • 22,304
  • 4
  • 41
  • 45
6

I am not sure but can you try

   NSArray *myNsArray = [NSKeyedUnarchiver unarchiveObjectWithData:myNsData];
visakh7
  • 26,380
  • 8
  • 55
  • 69