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

URLByAppendingPathComponent:

Returns a new URL made by appending a path component to the original URL. あるパス構成要素を元のURLに追加することによって作られる新しいURLを返します。

Declaration 宣言

- (NSURL *)URLByAppendingPathComponent:(NSString *)pathComponent;

Parameters パラメータ

pathComponent

The path component to add to the URL, in its original form (not URL encoded). URLに加えるパス構成要素、それの元の形式で(URL符号化されない)。

Return Value 戻り値

A new URL with pathComponent appended. pathComponentを追加された新しいURL。

Discussion 議論

If the original URL does not end with a forward slash and pathComponent does not begin with a forward slash, a forward slash is inserted between the two parts of the returned URL, unless the original URL is the empty string. 元のURLがフォワードスラッシュで終わらないそしてpathComponentがフォワードスラッシュで始まらないならば、1つのフォワードスラッシュがこの返されるURLの2つの部分の間に挿入されます、元のURLが空の文字列でない限り。

If the receiver is a file URL and pathComponent does not end with a trailing slash, this method may read file metadata to determine whether the resulting path is a directory. This is done synchronously, and may have significant performance costs if the receiver is a location on a network mounted filesystem. You can instead call the URLByAppendingPathComponent:isDirectory: method if you know whether the resulting path is a directory to avoid this file metadata operation. レシーバがファイルURLであるそしてpathComponentが後に引きずるスラッシュで終わらないならば、このメソッドはファイルメタデータを読み込むことで、結果パスがディレクトリであるかどうかを決定するかもしれません。これは同期的に行われます、そして重大な性能上の対価を要するかもしれません、もしレシーバがネットワークマウントされたファイルシステム上のある位置ならば。あなたは、代わりにURLByAppendingPathComponent:isDirectory:メソッドを呼び出すことが可能です、もしあなたが結果パスがディレクトリであるかどうかを知っていてこのファイルメタデータ演算を避けるならば。

See Also 参照

Modifying and Converting a File URL ファイルURLを修正および変換する