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

删除回忆录丶 提交于 2019-12-05 10:56:41

问题


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?


回答1:


See this post... Convert NSArray to NSData

The last comment deals with the reverse....

NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithData:data]



回答2:


I am not sure but can you try

   NSArray *myNsArray = [NSKeyedUnarchiver unarchiveObjectWithData:myNsData];


来源:https://stackoverflow.com/questions/6108924/how-can-i-convert-a-nsdata-to-nsarray

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!