NSString *executableFile = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleExecutableKey];
还有其它很多信息可由infoDictionary获得,以下是官方文档里的说明:
information Property List Keys
Standard keys found in a bundle’s information property list file.
const CFStringRef kCFBundleInfoDictionaryV
const CFStringRef kCFBundleExecutableKey;
const CFStringRef kCFBundleIdentifierKey;
const CFStringRef kCFBundleVersionKey;
const CFStringRef kCFBundleDevelopmentRegi
const CFStringRef kCFBundleNameKey;
const CFStringRef kCFBundleLocalizationsKe
Constants
kCFBundleInfoDictionaryV
The version of the information property list format.
Available in iOS 2.0 and later.
Declared in CFBundle.h.
kCFBundleExecutableKey
The name of the executable in this bundle (if any).
Available in iOS 2.0 and later.
Declared in CFBundle.h.
kCFBundleIdentifierKey
The bundle identifier.
Available in iOS 2.0 and later.
Declared in CFBundle.h.
kCFBundleVersionKey
The version number of the bundle.
For Mac OS 9 style version numbers (for example “2.5.3d5”), clients can use CFBundleGetVersionNumber
Available in iOS 2.0 and later.
Declared in CFBundle.h.
kCFBundleDevelopmentRegi
The name of the development language of the bundle.
When CFBundle looks for resources, the fallback is to look in the lproj whose name is given by the kCFBundleDevelopmentRegi
Available in iOS 2.0 and later.
Declared in CFBundle.h.
kCFBundleNameKey
The human-readable name of the bundle.
This key is often found in the InfoPlist.strings since it is usually localized.
Available in iOS 2.0 and later.
Declared in CFBundle.h.
kCFBundleLocalizationsKe
Allows an unbundled application that handles localization itself to specify which localizations it has available.
Available in iOS 2.0 and later.
Declared in CFBundle.h.
Declared In
CFBundle.h