Instance Method インスタンスメソッド

initWithString:

Initializes an NSURL object with a provided URL string. NSURLオブジェクトをある提供されたURL文字列で初期化します。

Declaration 宣言

- (instancetype)initWithString:(NSString *)URLString;

Parameters パラメータ

URLString

The URL string with which to initialize the NSURL object. This URL string must conform to URL format as described in RFC 2396, and must not be nil. This method parses URLString according to RFCs 1738 and 1808. URL文字列、それでNSURLオブジェクトを初期化することになります。このURL文字列は、RFC 2396で記述されるとおりにURL形式に準拠しなければなりません、そしてnilであってはいけません。このメソッドは、URLStringをRFCs 1738と1808に従って構文解析します。

Return Value 戻り値

An NSURL object initialized with URLString. If the URL string was malformed, returns nil. あるNSURLオブジェクト、URLStringで初期化されます。URL文字列が不正な形式だったならば、nilを返します。

Discussion 議論

This method expects URLString to contain only characters that are allowed in a properly formed URL. All other characters must be properly percent escaped. Any percent-escaped characters are interpreted using UTF-8 encoding. このメソッドは、適切に形成されたURLに入れるのを許可される文字のみを含むことをURLStringに期待します。全ての他の文字は、適切にパーセントエスケープされなければなりません。あらゆるパーセントエスケープされた文字は、UTF-8符号化を使って解釈されます。

See Also 参照

Creating an NSURL Object NSURLオブジェクトを作成する