Instance Method

initWithBase64EncodedData:options:

Initializes a data object with the given Base64 encoded data.

Declaration

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

Parameters

base64Data

A Base64, UTF-8 encoded data object.

options

A mask that specifies options for Base64 decoding the data. Possible values are given in NSDataBase64DecodingOptions.

Return Value

A data object containing the Base64 decoded data. Returns nil if the data object could not be decoded.

Discussion

The default implementation of this method will reject non-alphabet characters, including line break characters. To support different encodings and ignore non-alphabet characters, specify an options value of NSDataBase64DecodingIgnoreUnknownCharacters.

See Also

Encoding and Decoding Base64 Representations

- initWithBase64Encoding:

Initializes a data object initialized with the given Base64 encoded string.

Deprecated
- initWithBase64EncodedString:options:

Initializes a data object with the given Base64 encoded string.

- base64EncodedDataWithOptions:

Creates a Base64, UTF-8 encoded data object from the string using the given options.

- base64EncodedStringWithOptions:

Creates a Base64 encoded string from the string using the given options.

- base64Encoding

Initializes a Base64 encoded string from the string.

Deprecated
NSDataBase64EncodingOptions

Options for methods used to Base64 encode data.

NSDataBase64DecodingOptions

Options to modify the decoding algorithm used to decode Base64 encoded data.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software