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

resourceValuesForKeys:error:

Returns the resource values for the properties identified by specified array of keys. いくらかのキーからなる指定された配列によって識別されるプロパティそれらに対するリソース値を返します。

Declaration 宣言

- (NSDictionary<NSURLResourceKey, id> *)resourceValuesForKeys:(NSArray<NSURLResourceKey> *)keys 
                                                        error:(NSError * _Nullable *)error;

Parameters パラメータ

keys

An array of property keys for the desired resource properties. 望むリソースプロパティに対するプロパティキーそれらからなるある配列。

error

The error that occurred if one or more resource values could not be retrieved. This parameter is optional. If you are not interested in receiving error information, you can pass nil. 発生したエラー、もし1つ以上のリソース値が回収されることができなかったならば。このパラメータは随意です。あなたが受け取っているエラー情報に興味がないならば、あなたはnilを渡すことができます。

Return Value 戻り値

A dictionary of resource values indexed by key. キーによってインデックスをつけられるリソース値それらからなるある辞書。

Discussion 議論

This method first checks if the URL object already caches the specified resource values. If so, it returns the cached resource values to the caller. If not, then this method synchronously obtains the resource values from the backing store, adds the resource values to the URL object's cache, and returns the resource values to the caller. このメソッドは最初にURLオブジェクトが今までに指定されたリソース値それらをキャッシュするかを調べます。もしそうならば、それはキャッシュされたリソース値それらを呼出し側に返します。そうでないならば、その時このメソッドは同期的にリソース値それらをバッキングストアから入手して、リソース値それらをURLオブジェクトの持つキャッシュに加えて、そしてそのリソース値それらを呼出し側に返します。

The type of the returned resource value varies by resource property; for details, see the documentation for the key you want to access. 返されるリソース値の型は、リソースプロパティによって様々です;詳細は、あなたがアクセスを望むキーに対する文書化を見てください。

If the result dictionary does not contain a resource value for one or more of the requested resource keys, it means those resource properties are not available for the URL, and no errors occurred when determining those resource properties were not available. 結果辞書が1つ以上の要請されたリソースキーに対してリソース値を含まないならば、それは、それらリソースプロパティがURLに対して利用可能でない、そしてそれらリソースプロパティが利用可能でなかったことを決定している時にエラーが起こらなかったことを意味します。

If an error occurs, this method returns nil and populates the object pointer referenced by error with additional information. エラーが発生するならば、このメソッドはnilを返します、そしてerrorによって参照されるオブジェクトポインタには追加情報が入れられます。

See Also 参照

Accessing Resource Values リソース値にアクセスする

Related Documentation 関連文書