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

initWithPath:

Initializes an NSDistributedLock object to use as the lock the file-system entry specified by a given path. NSDistributedLockオブジェクトを初期化して、ある与えられたパスによって指定されるファイルシステム登録項目のロックとして使うようにします。

Declaration 宣言

- (instancetype)initWithPath:(NSString *)path;

Parameters パラメータ

aPath

All of aPath up to the last component itself must exist. You can use NSFileManager to create (and set permissions) for any nonexistent intermediate directories. aPathの全てその最後の構成要素それ自身に至るまでが存在しなければなりません。あなたは、NSFileManagerを使って、何らかの存在しない中間のディレクトリのために作成(そしてパーミッションを設定)を行えます。

Return Value 戻り値

An NSDistributedLock object initialized to use as the locking object the file-system entry specified by aPath. aPathによって指定されるファイルシステム登録項目をロックしているオブジェクトとして使うように初期化されたNSDistributedLockオブジェクト。

Discussion 議論

For applications to use the lock, aPath must be accessible to—and writable by—all hosts on which the applications might be running. ロックを使うことになるアプリケーションに対して、aPathは、それの上でアプリケーションが動作することになるかもしれない全てのホストにとってアクセス可能 — そしてそれによって書き込み可能 — でなければなりません。

See Also 参照

Creating an NSDistributedLock NSDistributedLockを作成する