How can i convert a NSData to NSArray? [duplicate]

2019-04-04 02:51发布

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?

2条回答
家丑人穷心不美
2楼-- · 2019-04-04 03:32

See this post... Convert NSArray to NSData

The last comment deals with the reverse....

NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithData:data]
查看更多
我想做一个坏孩纸
3楼-- · 2019-04-04 03:48

I am not sure but can you try

   NSArray *myNsArray = [NSKeyedUnarchiver unarchiveObjectWithData:myNsData];
查看更多
登录 后发表回答