Question

I have a NSString object that contains, for example, the encoded string : Tm8gMQ==

Because I recover a NSString object and not an NSData object, how am I suppose to decode it ?

Thank you.

Was it helpful?

Solution

Used NSDATA-BASE64 extension

NSString *nice=@"Tm8gMQ==";
NSData *data = [NSData dataFromBase64String:nice];
NSString *convertedString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"%@",convertedString);

Output

2013-06-13 17:23:58.467 Cool[5395:11303] No 1
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top