plist

Can i modify Root.plist in settings bundle dynamically?

亡梦爱人 提交于 2019-11-29 07:21:58
I have a settings bundle in my app.. containing root.plist now i have a screen which contains a checkbox .. on pressing the check box i want to change the BOOL value for DefaultValue key of PSToggleSwitchSpecifier in the plist. Since its being done at runtime.. my question is that .. can the file be changed at runtime and if yes.. give an idea how to do it?? here is the plist: <plist version="1.0"> <dict> <key>PreferenceSpecifiers</key> <array> <dict> <key>DefaultValue</key> <string></string> <key>Key</key> <string>Username</string> <key>Title</key> <string>Username</string> <key>Type</key>

Using PLists for Persistence on iPhone

五迷三道 提交于 2019-11-29 05:21:21
Simple question about property lists within an iphone app. I know you can read data in from a plist, but is there a way to write user-inputted data to a plist? If so, how? It's easy to find tutorials on reading information from plists, but I'm having trouble finding resources on writing to plists. This is how I write data items to a plist: [myPlistFile setInteger: myInt forKey: @"someKey"]; Of course, you can change setInteger with setBool, etc for different types. Hope this helps! -- Edit: If your .plist was a member of an important class or similar... Header of myClass: NSUserDefaults*

Write and Read a plist in swift with simple data

若如初见. 提交于 2019-11-29 05:11:53
i'm trying to understand how to save a simple value, an integer, in a plist. but i'm finding on the net only solution for save dictionary and array and i don't understand what i can change to work it only for an integer. this is the code for the moment... var musicalChoice = 1 var musicString : String = "5" override func viewDidLoad() { super.viewDidLoad() musicString = String(musicalChoice)} override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func writePlist() { let paths = NSSearchPathForDirectoriesInDomains(

How do I append a new item to a plist?

你。 提交于 2019-11-29 04:52:54
In my iPhone app, I have two plist files to store "Themes". One is a read-only file containing default themes, and one contains custom Themes that the user has created. I'm using plist files because it's very easy for me to read from the plist and create new Theme objects. My plist is an array of dictionary objects. Is there any easy way to append a new dictionary object to my plist file? Or do I need to read the file into memory, append the new dictionary object, and write it back to the filesystem? Thanks! With Cocoa, you need to read the file into memory, append the new dictionary object,

CFBundleDocumentTypes & UIFileSharingEnabled issues

≡放荡痞女 提交于 2019-11-29 03:54:45
问题 Has anyone gotten UIFileSharingEnabled or CFBundleDocumentTypes to work? I added UIFileSharingEnabled as true to my plist and used Apple's example from the link below for CFBundleDocumentTypes, but can't seem to get it to work. I don't see my app under file sharing in iTunes, and I do not get the option to open documents I registered in my app when I click on them in the mail.app http://developer.apple.com/iphone/library/documentation/General/Conceptual/iPadProgrammingGuide/CoreApplication

Xcode “Cannot parse contents of Info.plist”

寵の児 提交于 2019-11-29 02:51:22
I just hit a brick wall with xCode not wanting to parse my Info.plist file. I've replaced the file several times with older (identical) versions of the file that I had previously backed up, and I'm still getting the same error. Here is the complete error message: couldn't parse contents of '/Users/...Info.plist': The data couldn’t be read because it isn’t in the correct format. I'm clueless on this one. I'm using xCode 5.0.1, Mavericks This is one of the best way to detect on which line the error is occurring. Just go the directory where the plist file is present then write this command on

Entitlements.plist not created properly

不问归期 提交于 2019-11-29 02:34:12
问题 reading the doc from apple I need to create an ad-hoc distribution app, and to do so I need the entitlements.plist. when i create a new entitlement, the value "get-task-allow" is not present, so I added by hand.. is right?? at the end the Entitlements.plist is this: <?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>application-identifier</key> <string>$

How to regenerate an iPhone Xcode info.plist file

喜欢而已 提交于 2019-11-29 02:27:41
I have moved my iPhone app from one machine to another. In the process my info.plist file seems to have a bad bundle identifier and is not working. I want to create an entirely new info.plist file for my project. How can I do this? Here's a clean info.plist for you. Don't forget to replace xxx.yyy, and rename xib file (if required) <?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>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleDisplayName</key>

Xcode 4.6 localization within plist file

泄露秘密 提交于 2019-11-28 23:20:58
问题 I have started adding more languages to a project of mine and got strings & graphics localized without much trouble. I have one last problem and it is with a plist file. This plist file holds default category names for the app and is filled with English strings in a dictionary. My question is: is there a way to localize a plist file? I though about adding localized strings to the plist but could not figure out how. I dont want to have to decide in code what plist file to take since the

Use User-Defined build settings in custom .plist file

杀马特。学长 韩版系。学妹 提交于 2019-11-28 21:58:31
问题 I have different build configurations (Debug, Stage, Prod) defined for my app and I use User-Defined build settings: to set up Facebook login and other stuff in Info.plist file: In this scenario the $(USER_DEFINED_SETTINGS) notation does work. When I tried to set up Google SignIn , which requires using additional .plist file ( GoogleService-Info.plist ), and I used User-Defined settings in the same way I do in the Info.plist file, it doesn't work. How can I use User-Defined settings in custom