-4

i need to encode some string(like UID,PWD) using Base64 in objective C how can i do it. can anybody share the code.

Thanks in advance

deep29
  • 1
  • 2

2 Answers2

0

While Sailesh's answer is probably the easiest way, Apple also provides some (more low level) example code in the "Security Transforms Programming Guide".

https://developer.apple.com/library/mac/#documentation/Security/Conceptual/SecTransformPG/SecurityTransformsBasics/SecurityTransformsBasics.html

However this is only available in Mac OS 10.7 or higher.

codingFriend1
  • 6,487
  • 6
  • 45
  • 67
0

I am using the xmppframework library for my iphone project, and there are these two NSData Categories that take care of encoding(decoding) to(from) base64.

NSDataAdditions.h

NSDataAdditions.m

You should be able to use this category in your project.

Sailesh
  • 25,517
  • 4
  • 34
  • 47