Tag: plist

Filemaker:导出PLIST(iOS版)

我有一个数据库,我想导出为iOS兼容的PLIST。 我想到的工作是创build一个计算的字段,添加标记的填充和标题,并使用这些字段创build一个报告。 然后将报告的预览导出为PDF,在Acrobat Reader中打开PDF,select所有文本,复制并粘贴到识别PLIST格式的XCode中,并按预期工作。 有没有更好的方法来做到这一点? (这似乎是一个非常复杂的做事方式,错误的机率很高等)。作为XML的导出选项看起来很有希望,但我似乎无法join点。

在select器中显示数据

有人可以向我解释为什么当我从plist中加载时,我的select器没有显示任何数据 这是plist: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>England</key> <array> <string>Chelsea</string> <string>Arsenal</string> </array> <key>Spain</key> <array> <string>Barca</string> <string>Real</string> </array> </dict> </plist>` 这是viewController.m的一部分 – (void)viewDidLoad { [super viewDidLoad]; NSBundle *bundle = [NSBundle mainBundle]; NSURL *plistFile = [bundle URLForResource:@"myPListFile" withExtension:@"plist"]; NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfURL:plistFile]; self.countryClubs = dictionary; NSString *selectedCountry = […]

保护ipad应用程序中的plist

在我的应用程序中,我将当前的文档目录中的服务URL和他们的用户/密码保存在plist中。 我想将用户和密码移到钥匙串,并保护plist文件。 我尝试使用在这个例子中给出的keychainwrapper类,但不知道如何添加项目。 如何将包含用户名和密码的字典数组添加到钥匙串中,并保护我的plist文件?

部分中的行数

我有一个从plist填充的表视图。 在plist中我有一个Categories数组: Catgeories – Array item 0 – Maths item 1 – English …. 在同一个plist我有一个Notes数组 Notes – Array item 0 – Dictionary Title – My maths note 1 Text – This is algebra Category – Maths item 1 – Dictionary Title – My English Text – This is algebra Category – English 我有几个部分… – (NSInteger)numberOfSectionsInTableView:(UITableView […]

如何读取Plist数据到UITableView

可能重复: 如何从PList获取数据到UITableView? 我有一个plist字典和每个字典的string数量。显示在下面的URL。这个项目列表是plist中的成千上万。 现在要将这些列表显示在tableview中 。 现在我怎么能显示这个plist到UITableView 我正在尝试的是: – (id)readPlist:(NSString *)fileName { NSString *error; NSPropertyListFormat format; id plist; NSString *localizedPath = [[NSBundle mainBundle] pathForResource:@"A" ofType:@"plist"]; dic =[NSDictionary dictionaryWithContentsOfFile:localizedPath]; plist = [NSPropertyListSerialization propertyListFromData:dic mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&error]; if (!plist) { NSLog(@"Error reading plist from file '%s', error = '%s'", [localizedPath UTF8String], [error UTF8String]); [error release]; } return plist; […]

来自Plist的数据在UITableView中被错误地命令

我有存储在plist中的数据,但是当我把它拉到我的UITableView它由于某种原因被重新sorting。 这里是我的表视图数据源方法: – (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return [self.lunch_Dinner count]; } – (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { return [[self.lunch_Dinner allKeys] objectAtIndex:section]; } – (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { NSString *typeOfEntree = [self tableView:tableView titleForHeaderInSection:section]; return [[self.lunch_Dinner valueForKey:typeOfEntree] count]; } – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"EntreeCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if […]

将IOS数据保存到plist

我正在将这些数据写入plist文件,但每次写入时,都会replace以前的文件。 即它重写了我以前在重新加载页面时所有的数据。 我怎样才能使以前的数据坚持或有人指出我不正确的做法? – (IBAction)buttonClickSave:(id)sender; { pathList=[self getFilePath]; if(![[NSFileManager defaultManager] fileExistsAtPath:pathList]) { [[NSFileManager defaultManager] copyItemAtPath:[[NSBundle mainBundle] pathForResource:@"adresses" ofType:@"plist" ]toPath:pathList error:nil]; } NSString *Name = @"Names"; NSString *email = @"email"; NSString *phone = @"phone"; NSMutableArray *values = [[NSMutableArray alloc] initWithObjects:Name, email, phone, nil]; NSMutableArray *keys = [[NSMutableArray alloc] initWithObjects:kTitleKey, kEmail, kPhone, nil]; NSDictionary *dict = [[NSDictionary […]

遍历.plist字典。 types不匹配

我正在试图从plist文件迭代嵌套的字典。 问题是在分解内容时types不匹配。 我总是得到NSObject,NSDict和其他NSstuff无法转换为stringvariables,包括当我使用“(价值)”,string(),作为..如何分解一个plist字典子集元组?(数组) ? func LoadPlistContacts() { let path = NSBundle.mainBundle().pathForResource("ContactList", ofType: "plist") var AppContactsList = NSDictionary(contentsOfFile: path!) ListKeys = sorted(AppContactsList!.allKeys as! [String]) for key in ListKeys { var (AppPersonName, AppPersonSurname, AppPersonCompany, AppPersonPhone) = AppContactsList[key] } } 更新:我用字典而不是数组更改了plist,并更新了代码,但types不匹配仍然存在。 正如Airspeed Velocity和nhgrif在评论中指出的那样,更新后的plist的例子确实变得混乱了。 我应该做嵌套循环,如果与评论错误的行不能解决它? 谢谢。 var ListKeys: [String]! var ListContacts: [String: String]! func LoadPlistContacts() { if let path […]

使用Dropbox在空中分发应用程序时出错

我正在使用企业证书使用Dropbox按照以下链接在空中分发: http : //aaronparecki.com/articles/2011/01/21/1/how-to-distribute-your-ios-apps-over-the-air 在创buildplist时,我使用了一个虚拟的应用程序URL和标题,例如https ….. ipa,AppName resp。 Ipa和plist上传到Dropbox 从Dropbox使用plist共享链接并在HTML文件中提及 我使用了HTML网页/文档共享链接(由dl.dropboxusercontent.comreplacewww.dropbox.com)。 但无法下载应用程序。 在下载时出现错误: Unable to download app. "AppName" can not be downloaded at this time. Unable to download app. "AppName" can not be downloaded at this time. 控制台消息: BG Application: Not Present, BG Daemon: Present. Daemons: networkd apsd itunesstored <Error>: FAILURE: Failed to open property […]

将plist加载到iOS TableView中

我有一个plist( images.plist )以下内容 正如你所看到的,每个项目都有一个从0到19的数字键。 每个项目也有两个string(fileName和fileInfo)。 我试图加载所有的文件名到一个TableView。 这是我的尝试: RosterMasterViewController.h @interface RosterMasterViewController : UITableViewController @property (nonatomic, strong) NSDictionary *roster; @end RosterMasterViewController.m @implementation RosterMasterViewController @synthesize roster = _roster; … // This is in my 'viewDidLoad' NSString *file = [[NSBundle mainBundle] pathForResource:@"images" ofType:@"plist"]; self.roster = [NSDictionary dictionaryWithContentsOfFile:file]; 这就是我想如何加载文件名到原型单元格。 RosterMasterViewController.m – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier […]