plist

How to enable “use low resolution” on Retina display for an Application when shipping it?

孤街浪徒 提交于 2019-11-28 07:50:45
I have an application that breaks in HiDPI mode unless I chose "get Info" in finder and there tick the "open in low resolution" checkbox. Fixing the application is not an option as it was made using authoring software that is no longer really actively maintained by its vendor. Now here is the thing: When I take the application, put it on the desktop, zip it and afterwards set the "open in low resolution" checkbox to true, delete the application and unzip the original one the checkbox stays checked. So wherever OS X stores the property "open in low resolution" it's not along with the file. That

getting data from plist to NSMutableArray and writing the NSMutableArray to same plist iPhone

限于喜欢 提交于 2019-11-28 06:49:06
问题 Using this code I am trying to get the data from Templates.plist file but I am getting null value in array. //from plist NSString *path = [[NSBundle mainBundle] pathForResource:@"Templates" ofType:@"plist"]; NSMutableArray *arry=[[NSMutableArray alloc]initWithContentsOfFile:path]; NSLog(@"arrayArray:::: %@", arry); This is my plist file: Also I want to know how can I add more strings to this plist file and delete a string from this plist. 回答1: First off you cannot write to anything in you

Is it possible to create mutable versions of objects read in from a plist

*爱你&永不变心* 提交于 2019-11-28 06:24:06
问题 I'm reading into my application a plist which at the top level is an array. It's simple enough to make sure the array starts as mutable self.plistData = [[NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"myDataSource" ofType:@"plist"]] mutableCopy]; Within each element of the array is another array, each of those contains a dictionary. Based on a tablecell selection I'm changing attributes for the dictionary at the selected index: [self.cellDescriptors[indexPath

How can I load a default language plist if the localized version does not exist for the current language?

这一生的挚爱 提交于 2019-11-28 06:19:22
问题 I am loading the plist like so: NSString * plistPath = [[NSBundle mainBundle] pathForResource:@"Names" ofType:@"plist"]; NSDictionary * contentArray = [[NSDictionary alloc] initWithContentsOfFile:plistPath]; But contentArray is nil if the plist doesn't exist for the current device's language. How can I default to English? 回答1: NSBundle effectively uses the CFBundleDevelopmentRegion (aka "Localization native development region") entry in the application/bundle's Info.plist file to specify the

Appending data to PLIST - iPhone

耗尽温柔 提交于 2019-11-28 05:53:41
问题 we need to be able to read in the contents of an existing plist file then add to the array / dictionary then write this new data to the plist file. The stricture is simple. We want multiple root keys as arrays and each with a few values. The structure looks like this, 124818240124810284.JPG Array item 0 String Some Attribute 1 item 1 String Some Attribute 2 So far we can create the above with no issue. But, as soon as we go to write another array to the plist the file is simply overwritten

how to write NSMutableDictionary into Plist

余生长醉 提交于 2019-11-28 05:12:46
问题 can any one help me with this how to write a NSMutableDictionary into a plist.... thanks in advance.. 回答1: Make sure the pList file you are writing to is located in a legal place to edit it, for example Documents in the apps sandbox. Then find the path to that location (if there is an existing pList file, it will overwrite), and use: [myDictionary writeToFile:path atomically:YES]; Write how far you are in the process, and maybe some code / error-message... 回答2: [yourDict writeToFile:filePath

arrayWithContentsOfFile can't read plist file

喜欢而已 提交于 2019-11-28 04:04:51
问题 i have a plist with an array that contain 2 strings see image : http://imageshack.us/photo/my-images/263/myplist.png/ and in my viewDidLoad i add this : NSString *file = [[NSBundle mainBundle] pathForResource:@"Data" ofType:@"plist"]; NSArray *array = [NSArray arrayWithContentsOfFile:file]; NSLog(@"array = %@", array); But i got always null why? Thanks for help. UPDATE : the solution is that you need to manually edit the plist file (Xcode4 use Dictionnary by default) <?xml version="1.0"

Convert Excel document (xls) to a plist

拥有回忆 提交于 2019-11-28 03:29:32
I have a pretty straightforward Excel spreadsheet, and I need to use the data in an iPhone app. The xls document has 6 columns, and > 200 rows. I would like to create a plist from the xls document. How can I convert one to the other, programmatically? I'm late to the party but I built a desktop utility that will convert CSV to a plist. You can download the binary or use this code, which requires cCSVParse . It uses whatever is in row 0 to create key names, then generates dictionaries for each successive row. CSVParser *parser = [CSVParser new]; [parser openFileWithPath:pathAsString];

iPhone Icon@2x.png not showing in Retina display

六月ゝ 毕业季﹏ 提交于 2019-11-28 03:21:12
For some reason, the iPhone 4 refuses to display my high resolution icon file. I've checked out these solutions, none of which have worked for me: How to setup normal Icon for iPhone3 and Retina for iPhone 4 http://developer.apple.com/library/ios/#qa/qa2010/qa1686.html http://appworks.radeeccles.com/programming/cfbundleiconfiles-nice-ready-prime-time/ The icons are in my resources group, and are all named correctly: Icon.png Icon@2x.png Icon-72.png I've also tried adding them to the Info.plist file, first as an array, then as a dictionary, then simply deleting all icon references from the

Deleting plist file does not reset app on macOS 10.9+

99封情书 提交于 2019-11-28 03:11:58
While developing a Cocoa application on 10.9, I have noticed that if I go to ~/Library/Preferences and delete the plist file for my app (to reset it), on the next build-and-run, the app behaves as if the plist file had never been deleted at all. It took me a long time to track down why this happens and I did not see a question/answer about it on SO, so I'm writing this question and answering it myself to help others. On 10.9, the system is doing some more robust "caching" of preferences. After deleting the plist file, I fired up Activity Monitor and force-killed the "cfprefsd" process. Be