Contents

URLWithString:encodingInvalidCharacters:

Creates and returns an instance from the provided string, optionally IDNA- and percent-encoding any invalid characters.

Declaration

+ (instancetype) URLWithString:(NSString *) URLString encodingInvalidCharacters:(BOOL) encodingInvalidCharacters;

Parameters

  • URLString:

    A URL location.

  • encodingInvalidCharacters:

    A Boolean value that indicates whether the initializer attempts to encode any invalid characters in string.

Discussion

If encodingInvalidCharacters is true, this initializer tries to encode the string to create a valid URL. If the URL string is still invalid after encoding, the method returns nil.

See Also

Creating a URL object