Returns the full pathname for the resource identified by the specified name and file extension and located in the specified bundle subdirectory.
- iOS 2.0+
- macOS 10.0+
- tvOS 9.0+
- watchOS 2.0+
The name of the resource file.
If you specify
nil, the method returns the first resource file it finds that matches the remaining criteria.
The filename extension of the files to locate.
If you specify an empty string or
nil, all the files in
subpathand its subdirectories are returned. If an extension is provided the subdirectories are not searched.
The name of the bundle subdirectory.
The full pathname for the resource file, or
nil if the file could not be located.
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
Whether this method recurses through subdirectories is dependent on the
extension parameter. If
nil or an empty string it will recurse, otherwise, it does not. (The search order for the language-specific directories corresponds to the user’s preferences.) For details on how localized resources are found, read The Bundle Search Pattern in Bundle Programming Guide.