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

writeToFile:atomically:

Writes the contents of the receiver to the file specified by a given path. レシーバの内容をある与えられたパスによって指定されるファイルに書き出します。

Declaration 宣言

- (BOOL)writeToFile:(NSString *)path 
         atomically:(BOOL)useAuxiliaryFile;

Return Value 戻り値

YES if the file is written successfully, otherwise NO. YES、もしそのファイルがうまく書き込みされるならば、そうでなければNO

Discussion 議論

Writes the contents of the receiver to the file specified by path (overwriting any existing file at path). path is written in the default C-string encoding if possible (that is, if no information would be lost), in the Unicode encoding otherwise. レシーバの内容をpathによって指定されたファイルに書き出します(pathでのあらゆる既存のファイルを上書きします)。pathは、省略時のC文字列符号化で書き出されます、もし可能ならば(すなわち、情報が失われることがないならば)、そうでなければユニコード符号化で。

If flag is YES, the receiver is written to an auxiliary file, and then the auxiliary file is renamed to path. If flag is NO, the receiver is written directly to path. The YES option guarantees that path, if it exists at all, won’t be corrupted even if the system should crash during writing. flagYESならば、レシーバは補助ファイルに書き出されます、それからその補助ファイルはpathに改名されます。flagNOならば、レシーバは直接にpathに書き出されます。YESオプションはpathを保証します、それがともかく存在するならば、システムが書き出しの間にクラッシュするとしても。

If path contains a tilde (~) character, you must expand it with stringByExpandingTildeInPath before invoking this method. pathがチルダ(~)文字を含むならば、あなたはそれをstringByExpandingTildeInPathで、このメソッドを発動する前に展開しなければなりません。

See Also 参照

Deprecated 非推奨

Related Documentation 関連文書