Instance Method

initWithBase64Encoding:

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

Declaration

- (id)initWithBase64Encoding:(NSString *)base64String;

Parameters

base64String

A Base-64 encoded string.

Return Value

A data object built by Base-64 decoding the provided string. Returns nil if the data object could not be decoded.

Discussion

Although this method was only introduced publicly for iOS 7, it has existed since iOS 4; you can use it if your application needs to target an operating system prior to iOS 7. This method behaves like initWithBase64EncodedString:options:, but ignores all unknown characters.

See Also

Encoding and Decoding Base64 Representations

- initWithBase64EncodedData:options:

Initializes a data object with the given Base64 encoded data.

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