plist

How to extract strings from plist files for translation (localization)?

本秂侑毒 提交于 2019-12-10 21:19:36
问题 I need to prepare list of strings for translation of my iPhone application. I have extracted strings from *.m files using genstring and from the XIB files using ibtool command. But I have also lots of texts to translate in plist files (String field types enclosed in string tag). Is there a nice bash script / command to extract those strings into a flat txt file? I could review and filter it so my translators can work with nice list but not with alien looking XML file. 回答1: I made a custom

How to add multiple entries to a plist dictionary with PlistBuddy

China☆狼群 提交于 2019-12-10 17:50:03
问题 In my Info.plist file I want to modify a Plist file on the shell which looks like this: <plist version="1.0"> <dict> <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string>urlname-1</string> </dict> </array> </dict> </plist> Now I want to make it look like this using PlistBuddy, adding the CFBundleURLSchemes key with a string-array value (or every other value): <plist version="1.0"> <dict> <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string

Create an application plist

て烟熏妆下的殇ゞ 提交于 2019-12-10 15:55:49
问题 What would a Mac OS X Application Info.plist file look like? I only need the bare minimum, so that I have: Launches an executable Has an icon Thanks! 回答1: This is the real, bare minimum: <?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>CFBundleExecutable</key> <string>ExecutableFileName</string> <key>CFBundleIconFile</key> <string>AppIcon</string> </dict> </plist> It

NSDate behaviour when saving to plist

柔情痞子 提交于 2019-12-10 14:26:15
问题 I am creating a date from [NSdate date] and saving it to plist, Here is how I am creating a date - (void)applicationWillResignActive:(UIApplication *)application { NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; // [gregorian setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]]; NSDateComponents *weekdayComponents = [gregorian components:(NSDayCalendarUnit | NSYearCalendarUnit | NSMonthCalendarUnit | NSMinuteCalendarUnit)fromDate:[NSDate date]

Is it possible to create a device specific .plist file -iOS

天大地大妈咪最大 提交于 2019-12-10 12:24:58
问题 I am storing some data in a plist file.. and I have realised that it can be shared. Is there a way where I can make .plist files device specific? Maybe UDID or something? Any ideas will be much appreciated.. 回答1: If you don't want others to see the contents of your .plist files, you could encrypt them with iOS provided encryption algorithms. Other simple way would be storing your sensitive data in the keychain, or NSUserDefaults without writing to file, which would be very device specific.

How do I set plist values

岁酱吖の 提交于 2019-12-10 12:07:25
问题 I am trying to change some Safari settings and am trying to use com.apple.Safari.plist for this. These are the following key values I need to change com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptEnabled WebKitJavaScriptEnabled com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically WebKitJavaScriptCanOpenWindowsAutomatically com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled WebKitPluginsEnabled WebKitJavaEnabled I tried changing

Swift 3: cannot write data to plist file

只谈情不闲聊 提交于 2019-12-10 11:54:51
问题 I am trying to use a file called Data.plist to store some simple unstructured data, and I placed this file at the root folder of my app. To make it simple to read/write to this file, I created the following DataManager struct. It can read Data.plist file with no problem, but it cannot write data to the file. I am not sure where the problem is, could anyone spot where might be wrong? struct DataManager { static var shared = DataManager() var dataFilePath: String? { return Bundle.main.path

How to generate plists from rails models?

那年仲夏 提交于 2019-12-10 11:47:35
问题 I'm rather new at ruby (on rails) and I can't figure this one out; What is the best way to serialize objects to plist in rails? I'm using the plist library from rubyforge. And I have nested_attributes: class Deck deck has_many :cards accepts_nested_attributes_for :cards class Card belongs_to :deck I've tried in the deck controller to do this: format.plist { render :plist => @deck.to_plist } But I don't get the cards... Similar in xml, I can do this: format.xml { render :xml => @deck.to_xml(

Write into Settings bundle in Swift

怎甘沉沦 提交于 2019-12-10 10:55:46
问题 I have created an app with settings bundle in it and the app configuration can be changed. Reading from Settings bundle is done. I am using below code. let defs: NSUserDefaults = NSUserDefaults.standardUserDefaults() defs.synchronize() var settingsBundle: NSString = NSBundle.mainBundle().pathForResource("Settings", ofType: "bundle")! if(settingsBundle.containsString("")){ NSLog("Could not find Settings.bundle"); return; } var settings: NSDictionary = NSDictionary(contentsOfFile:

Device compabilities issue in iOS

主宰稳场 提交于 2019-12-10 10:53:47
问题 We uploaded an app where in the first version we added to device capabilities “telephony” to restrict only iPhone devices in the info plist. In the second version we forgot to add “telephony” and we submitted to the App store. Third version we are planning to upload with device capabilities as “telephony” but while submitting to the App Store it shows the warning: This bundle is invalid. The key UIRequiredDeviceCapabilities in the Info.plist may not contain values that would prevent this