views:

54

answers:

1

While decoding,I am getting NSData bytes by decoding a string.I am converting NSData bytes as string:

-(void)decodeAction:(NSString*)str
{

 NSData *data=[NSData base64DataFromString:str];
 NSString *stt=[NSString stringWithFormat:@"%@",data];
 printf("\n stt %s",[stt UTF8String]);

}

Then I am getting the following output:

<4f7c204d 6c204d61 604d6164 61616461 6164616e 24616e20 4d6e204d 6e204d6f 604d6f68 616f6861 6f68616e 28616e>

+1  A: 

You probably want:

NSString *stt = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

or something along those lines.

Isaac