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

stringByStandardizingPath

A new string made by removing extraneous path components from the receiver. 本質的でないパス構成要素をレシーバから取り除く事によって作られる新しい文字列。

Declaration 宣言

@property(readonly, copy) NSString *stringByStandardizingPath;

Discussion 議論

A new string made by performing the following operations: 新しい文字列は以下の演算を実行することによって作られます:

  • Expanding an initial tilde expression using stringByExpandingTildeInPath. 冒頭のチルダ式をstringByExpandingTildeInPathを使って展開。

  • Removing an initial component of “/private/var/automount”, “/var/automount”, or “/private” from the path, if the result still indicates an existing file or directory (checked by consulting the file system). 冒頭の構成要素の “/private/var/automount”、“/var/automount”、または “/private” をパスから取り除きます、もしその結果がまだ既存のファイルまたはディレクトリを指し示すならば(ファイルシステムに意見を求めることで調べられます)。

  • Reducing empty components and references to the current directory (that is, the sequences “//” and “/./”) to single path separators.

  • Removing a trailing slash from the last component. 後に引きずるスラッシュを最後の構成要素から取り除きます。

  • For absolute paths only, resolving references to the parent directory (that is, the component “..”) to the real parent directory if possible using stringByResolvingSymlinksInPath. For relative paths, references to the parent directory are left in place. 絶対パスに対してだけ、親ディレクトリ(すなわち、構成要素 “..” )への参照を実際の親ディレクトリに解決します、もしstringByResolvingSymlinksInPathを使うことが可能ならば。相対パスに対して、親ディレクトリへの参照はそのままにされます。

Returns self if an error occurs. selfを、エラーが発生するならば返します。

Note that the path returned by this method may still have symbolic link components in it. Note also that this method only works with file paths (not, for example, string representations of URLs). このメソッドによって返されるパスはまだシンボリックリンク構成要素をそれの中に持つかもしれないことに注意してください。またこのメソッドはファイルパスでのみ働くことにも注意してください(例えば、URLの文字列表現ではなく)。

See Also 参照

Working with Paths パスを扱う