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?
use this
NSData *decodedData = [[NSData alloc] initWithBase64EncodedString:base64String options:0];
instand of
NSData *data=[[NSData alloc]initWithBase64Encoding:(NSString *)dict];
Returns a data object initialized with the given Base-64 encoded string. (Deprecated in iOS 7.0. You should transition to either initWithBase64EncodedString:options
: or initWithBase64EncodedData:options
:.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With