Returns an array containing the pathnames for all bundle resources having the specified filename extension and residing in the resource subdirectory.
- iOS 2.0+
- macOS 10.0+
- tvOS 9.0+
- watchOS 2.0+
- Mac Catalyst 13.0+Beta
The filename extension of the files to locate.
If you specify an empty string or
nil, the extension is assumed not to exist and all of the files in
The name of the bundle subdirectory to search.
An array containing the full pathnames for all bundle resources matching the specified criteria. This method returns an empty array if no matching resource files are found.
This method provides a means for dynamically discovering multiple bundle resources of the same type. If
extension is an empty string or
nil, all bundle resources in the specified resource directory are returned.
subpath specifies the name of a specific subdirectory to search within the current bundle’s resource directory hierarchy. If
nil, this method searches the top-level nonlocalized resource directory and the top-level of any language-specific directories. (In macOS, the top-level nonlocalized resource directory is typically called
Resources but in iOS, it is the main bundle directory.) For example, suppose you have a Mac app with a modern bundle and you specify
@"Documentation" for the
subpath parameter. This method would first look in the
Contents/Resources/Documentation directory of the bundle, followed by the
Documentation subdirectories of each language-specific
.lproj directory. (The search order for the language-specific directories corresponds to the user’s preferences.) This method does not recurse through any other subdirectories at any of these locations. For details on how localized resources are found, read The Bundle Search Pattern in Bundle Programming Guide.