Instance Property インスタンスプロパティ

stringByDeletingLastPathComponent

A new string made by deleting the last path component from the receiver, along with any final path separator. 最後のパス構成要素をあらゆる最後のパス分離子を含めてレシーバから削除することによって作られる新しい文字列。

Declaration 宣言

@property(readonly, copy) NSString *stringByDeletingLastPathComponent;

Discussion 議論

A new string made by deleting the last path component from the receiver, along with any final path separator. If the receiver represents the root path it is returned unaltered. 最後のパス構成要素をあらゆる最後のパス分離子を含めてレシーバから削除することによって作られる新しい文字列。レシーバがルートパスを表すならばそれは変更なしで返されます。

The following table illustrates the effect of this method on a variety of different paths: 以下の表は、このメソッドの効果を様々な異なるパスに関して解説します:

Receiver’s String Value レシーバのもつ文字列値

Resulting String 結果文字列

/tmp/scratch.tiff

/tmp

/tmp/lock/

/tmp

/tmp/

/

/tmp

/

/

/

scratch.tiff

“” (an empty string) “”(空の文字列)

Note that this method only works with file paths (not, for example, string representations of URLs). このメソッドはファイルパスでのみ働くことに注意してください(例えば、URLの文字列表現ではなく)。

See Also 参照

Working with Paths パスを扱う