Returns the full pathname for the resource identified by the specified name and file extension.
- iOS 2.0+
- macOS 10.0+
- UIKit for Mac 13.0+Beta
- 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 with the specified extension.
The filename extension of the file to locate.
If you specify an empty string or
nil, the extension is assumed not to exist and the file is the first file encountered that exactly matches
The full pathname for the resource file, or
nil if the file could not be located.
The method first looks for a matching resource file in the non-localized resource directory of the specified bundle. If a matching resource file is not found, it then looks in the top level of an available language-specific
.lproj folder. (The search order for the language-specific folders corresponds to the user’s preferences.) It does not recurse through other subfolders at any of these locations. For more details on how localized resources are found, read The Bundle Search Pattern in Bundle Programming Guide.
The following code fragment gets the path to a plist within the bundle, and loads it into an