您的位置:首页 > 移动开发 > IOS开发

IOS获取plist文件属性值的方法

2012-07-22 16:52 501 查看
在项目中,很多的属性都是在plist文件中设置的,在开发过程中,经常会需要获取这些属性值,下面是获取plist属性值的方法

NSDictionary *bundleDic = [[NSBundle mainBundle] infoDictionary];

NSString *version = [bundleDic objectForKey:@"CFBundleVersion"];
其中,CFBundleVersion为plist文件的key。
plist文件的所有键值如下:

CFBundleDevelopmentRegion,

DTPlatformName,

CFBundleVersion,

LSRequiresIPhoneOS,

CFBundleSignature,

CFBundleIdentifier,

CFBundleExecutable,

CFBundleDisplayName,

CFBundleShortVersionString,

CFBundleName,

CFBundleSupportedPlatforms,

CFBundlePackageType,

NSBundleResolvedPath,

CFBundleInfoDictionaryVersion,

UIRequiredDeviceCapabilities,

UISupportedInterfaceOrientations,

NSBundleInitialPath,

CFBundleInfoPlistURL,

CFBundleExecutablePath,

DTSDKName,

UIDeviceFamily
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: