Instance Method

initWithBase64EncodedString:options:

Initializes a data object with the given Base64 encoded string.

Declaration

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

Parameters

base64String

A Base-64 encoded string.

options

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

Return Value

A data object built by Base64 decoding the provided string. 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

- initWithBase64EncodedData:options:

Initializes a data object with the given Base64 encoded data.

- initWithBase64Encoding:

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

Deprecated
- 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.