iphone - 访问 .plist 值

标签 iphone ios xcode ios5 ios6

我正在构建一个具有 pickerview 的应用程序,因此,我创建了一个 .plist 文件来制作键和值。唯一的问题是我希望能够访问 .plist 值。问题是,这些值是名称字符串,当在选择器 View 中选择时,我想创建一个 if 语句,我会在其中调用手机号码。如果可能的话,我需要有关访问值的指南

关于如何执行此操作的任何想法?

最佳答案

NSString *pathToFile = [[NSBundle mainBundle] pathForResource:@"myList" ofType:@"plist"];
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:pathToFile];

关于iphone - 访问 .plist 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13069117/

相关文章:

iPhone 设备 3.1 SDK 破坏 UITableViewCellStyleValue1 textLabel 的垂直对齐

iphone - 将可缩放图像保持在 UIScrollView 的中心

iphone - 如何覆盖选项卡栏的更多 Controller ?

ios - 如何: Home Screen Apps and offline usage on ios 6 – cache manifest obsolete?

ios - Swift 中的协议(protocol)问题

c++ - 有没有一种使用 C++ 在 mac OS X 中打开一个(或多个)opengl 窗口的简单方法?

iphone - 在 iPhone 上显示和创建 gif 图像

iphone - iPhone/iPad UIWebView 是否需要激活 View 才能呈现?

iphone - 如何在 Xcode 中禁用自动构建

xcode - Xcode 6.4 中 "Class Actions"和 "Class Outlets"在哪里?