Creating a base-64 string from NSData

亡梦爱人 提交于 2019-12-17 19:21:57

问题


How is it possible to get a base64 string from an NSData instance?


回答1:


please try to search before posting questions I already post a answer for this here - Verifying a Receipt with the App Store - try this function there.




回答2:


(if you targeting on IOS 7 ...) There is an easy way using provided API: https://stackoverflow.com/a/19088341/2481444

I also tested the accepted code. They both generate the same result.

It also has decoding function. @S.J




回答3:


NSString* base64String = [nsdata base64Encoding];


来源:https://stackoverflow.com/questions/6006823/creating-a-base-64-string-from-nsdata

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