'initWithBase64Encoding' is deprecated?

ios, nsdata, objective-c

Solution

use this

NSData *decodedData = [[NSData alloc] initWithBase64EncodedString:base64String options:0];

instand of

NSData *data=[[NSData alloc]initWithBase64Encoding:(NSString *)dict];

Problem

I want to get the data from the string. i am using the following code but it seems to be deprecated. ``` NSData *data=[[NSData alloc]initWithBase64Encoding:(NSString *)dict]; ``` I got the data. But its give me the warning that 'initWithBase64Encoding' is deprecated. So is there any other method that will return data?

Original source

Related problems