Tag: plist

plist在字典里面写数据

是否有可能通过代码在我们的捆绑或我们的资源编辑pList文件中的值? 这意味着我的plist文件不是以编程方式创build的,我想以编程方式编辑它的值。

无法保存plist ios

我能够保存plist文件在模拟器中,但我不能保存在设备中的Plist文件。 任何build议。 我在用着 NSString* dictPath = [[NSBundle mainBundle] pathForResource:@"Dictionary" ofType:@"plist"]; NSDictionary * dict = [[NSDictionary alloc] initWithContentsOfFile:dictPath]; 阅读文件 和 [dict writeToFile:dictPath atomically: YES]; 写入文件。

Tableview的Plistsearch

我有Plist这已被填充tableview扩大部分..现在我想search表…下面的图像,你可以看到什么事情发生时,我search任何东西。 。 只是因为我正在search它,但需要在cellforrowatindexpathsearch结果的一些变化…. 请检查代码,让我知道如何searchplist ..应该为cellforrowatindexpath更改和noofrowsinsectionsearchplist 。 。 – (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return [self.mySections count]; } – (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { NSInteger rows = 0; if ([self tableView:tableView canCollapseSection:section] || !(tableView == self.searchDisplayController.searchResultsTableView) ) { if ([expandedSections containsIndex:section] ) { NSString *key = [self.mySections objectAtIndex:section]; NSArray *dataInSection = [[self.myData objectForKey:key] objectAtIndex:0]; return [dataInSection count]; } return […]

我们如何在iOS设备上运行时处理启用/禁用背景audiofunction?

我知道如何设置我的iOS应用程序,使其使用plist在后台播放audio(=在iOS设备上使用另一个应用程序时)。 一些应用程序,如: – 布卢姆 – 一些广播播放器 提供了一个基本的UISwitch来启用或禁用此行为。 任何想法如何做到这一点?

是否有可能创build从plist读入的对象的可变版本

我正在阅读我的应用程序plist,在顶层是一个数组。 确保数组开始为可变是很简单的 self.plistData = [[NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"myDataSource" ofType:@"plist"]] mutableCopy]; 数组中的每个元素都是另一个数组,每个数组都包含一个字典。 基于表格单元格select,我正在改变选定索引处字典的属性: [self.cellDescriptors[indexPath.section][indexOfTappedRow] setValue:@"YES" forKey: @"isSelected"]; 我收到错误'-[__NSCFDictionary removeObjectForKey:]: mutating method sent to immutable object'当我尝试更改字典值时, '-[__NSCFDictionary removeObjectForKey:]: mutating method sent to immutable object' 。 如果由plist读入的NSDictionary是不可变的,那么错误是有意义的。 有没有办法从plist中读取内容,并确保任何数组或字典被读作可变版本?

在iOS中的UITextView不显示笑脸(表情符号)?

我已经存储所有的uni代码(emoji字符)在iPhone支持的plist。 当我直接写作 – (IBAction)sendButtonSelected:(id)sender { NSMutableArray *emoticonsArray = [[NSMutableArray alloc]initWithObjects:@"\ue415",nil]; NSString *imageNameToPass = [NSString stringWithFormat:@"%@",[emoticonsArray objectAtIndex:0]]; NSLog(@"imageNameToPass1…%@",imageNameToPass); messageTextView.text =imageNameToPass; } 它在textview中显示表情符号,但只要我从plist中取出 NSString *plistPath1 = [[NSBundle mainBundle] pathForResource:@"unicodes" ofType:@"plist"]; NSDictionary *dictionary = [[NSDictionary alloc] initWithContentsOfFile:plistPath1]; activeArray= [dictionary objectForKey:categoryString]; NSLog(@"activeArray…%@",activeArray); emoticonsArrayForHomeEmoji = [[NSMutableArray alloc]initWithCapacity:[activeArray count]]; for(int i=0; i<[activeArray count]; i++) { id objects = (id)[activeArray objectAtIndex:i]; [emoticonsArrayForHomeEmoji […]

如何在iOS中更改cordova-camera-plugin语言?

我想更改cordova-camera-plugin语言。 显然它依赖于各种各样的东西。 我的开发环境是Visual Studio 2015中的Cordova工具。它不太可能重要,但是我在我的应用程序中使用了Ionic框架。 我们在运行Xcode 7的MacBook Pro笔记本电脑上构buildiOS应用程序。我正在testing的设备是运行iOS 9.1的Ipad,其中荷兰语为第一语言,英语为第二语言。 在我的应用程序,当你打开相机,你有几个选项,如Cancel , Use Photo和Retake Photo 。 我所做的尝试使插件本地化为荷兰语的事情如下。 在config.xml我已经改变了以下行 <widget xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:vs="http://schemas.microsoft.com/appx/2014/htmlapps" id="hop.test1" version="1.0.1" xmlns="http://www.w3.org/ns/widgets" defaultlocale="nl-NL"> 并在我的/platforms/ios/projectname/projectname-Info.plist I have added the以下几行: <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>nl</string> <key>CFBundleLocalizations</key> <array> <string>nl</string> </array> <!– other values omitted !–> </dict> </plist> nl似乎是基于我的search结果周围谷歌和计算器的荷兰正确的本地化符号。 问题是,当我build立我的应用程序,并testing相机,相机button仍然是用英语写的。 我是否实施了错误的东西,我是否在某处丢失了某些值或者是否在本地化了一个Cordova插件的方法是错误的?

从plistparsing文本到NSAttributedString

我正在从plist中加载文本,并在我的应用程序中显示它。 理想情况下,我希望能够指定更复杂的格式,例如斜体,粗体和上标文本,并将其显示在自定义标签(如TTTAttributedLabel)中 。 有没有可用的库来parsing给定格式的string(最好是简单的文本格式,如Markdown或Textile)到NSAttributedString中? 我知道解决scheme可用于parsingRTF和HTML,但这是我的需要矫枉过正 – 再加上我希望文本很容易手写。 编辑:这是iOS / UIKit

如何以编程方式从plist添加和检索数据

你好我所有新的目标C,我想dynamic/编程插入数据到plist.please帮助我。这里是我的plist结构 root |_Client1 |_report1 |_application1 |_application2 |_report2 |_application3 |_Client2 |_report1 现在我想dynamic地添加和检索数据到application1,我的plist中的application2请帮助我

将一组新数据写入Plist,而不是覆盖它

我试图让一个plist来存储多组数据,但是每次保存(使用ActionSheet中的一个button),它都会覆盖之前的一组数据。 我想添加多个“朋友”和他们的数据。 我不太喜欢使用核心数据,所以我想知道如何用Plist做到这一点。 这里是保存button的代码: NSMutableDictionary *friend = [[NSMutableDictionary alloc] init]; NSMutableDictionary *array = [[NSMutableDictionary alloc]init]; [array setObject:friendName.text forKey:@"Name"]; [array setObject:friendPhone.text forKey:@"Phone Number"]; [array setObject:friendEmail.text forKey:@"Email Address"]; [array setObject:friendChatSN.text forKey:@"Chat Screen Name"]; [friend setValue:array forKey: @"Friend Data"]; NSArray *paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsPath = [paths objectAtIndex:0]; NSString *plistPath = [documentsPath stringByAppendingPathComponent:@"FriendList.plist"]; [friend writeToFile:plistPath […]