How can I read a string from a text input in objective C (iOS SDK), and treating it as UTF-16, encode the bytes to base64?
I’m struggling with both aspects, both treating the textbox’s value as UTF-16 and then encoding these bytes to UTF-16.
I appreciate there are probably partial or similar questions to this on SO, I have searched (and read the various posts), but I’m an iOS/Objective C beginner and could really benefit from a complete example here.
Convert the
NSStringto a UTF16-encodedNSDataby usingthen convert the resulting
NSDatainto Base64 using e.g. the answer from Converting between NSData and base64 strings.