简体   繁体   中英

Base64Encoding is deprecated : first deprecated in iOS 7.0

I've downloaded the Base64 library from GitHub.I used it in my project to decode the Images from webserver. I made this project for iOS7.0 The warning am getting with base64 is:

'base64Encoding' is deprecated : first deprecated in iOS7.0.

Thanks in advance.

Started from iOS 7 SDK , NSData class now has methods that help encode/decode base 64 data and string objects with the following:

- (instancetype)initWithBase64EncodedData:(NSData *)base64Data
                                  options:(NSDataBase64DecodingOptions)options

- (instancetype)initWithBase64EncodedString:(NSString *)base64String
                                    options:(NSDataBase64DecodingOptions)options

Once you got your NSData instances initialize a UIImage object with: + (UIImage *)imageWithData:(NSData *)data

types of encoding:

 - NSDataBase64Encoding64CharacterLineLength     
   NSDataBase64Encoding76CharacterLineLength     
   NSDataBase64EncodingEndLineWithCarriageReturn     
   NSDataBase64EncodingEndLineWithLineFeed

types of decoding:

- NSDataBase64DecodingIgnoreUnknownCharacters

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM