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

initWithContentsOfFile:

Initializes the receiver, a newly allocated NSString object, by reading data from the file named by path. レシーバ、ある新しく作成されたNSStringオブジェクトを、pathによって指名されたファイルからデータを読み出すことによって初期化します。

Declaration 宣言

- (id)initWithContentsOfFile:(NSString *)path;

Discussion 議論

Initializes the receiver, a newly allocated NSString object, by reading data from the file named by path. If the contents begin with a byte-order mark (U+FEFF or U+FFFE), interprets the contents as UTF-16 code units; otherwise interprets the contents as data in the default C string encoding. Returns an initialized object, which might be different from the original receiver, or nil if the file can’t be opened. レシーバ、ある新しく作成されたNSStringオブジェクトを、pathによって指名されたファイルからデータを読み出すことによって初期化します。内容がバイトオーダーマーク(U+FEFFまたはU+FFFE)で始まるならば、内容をUTFー16コード単位として解釈します;そうでなければ内容をデータとして省略時のC文字列符号化で解釈します。初期化されたオブジェクトを返します、それは元のレシーバとは異なるかもしれません、またはそのファイルが開かれることができないならばnil

See Also 参照

Deprecated 非推奨

Related Documentation 関連文書