开发者

How to convert a string to NSData

开发者 https://www.devze.com 2023-02-04 18:03 出处:网络
i have a string that I use to create a file.I now need to take that file and get it into an NSData object for sending as an email.

i have a string that I use to create a file. I now need to take that file and get it into an NSData object for sending as an email.

I'm sorry, but I haven't a clue how to get a string into an NSData object! 开发者_StackOverflow中文版Can someone please help me?


Use NSData.FromString (string s), unless you mean loading a file name that is stored in a string and getting the NSData of that, in which case use NSData.FromStream (new FileStream (filename, FileMode.Open));

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号