plist

Plist cannot be read … What am I doing wrong?

馋奶兔 提交于 2019-12-11 14:47:29
问题 I have got a plist in my Resources folder called "levelconfig.plist" and I want to read something out of it. I did the following : -(NSString *) dataFilePath { NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentDirectory = [path objectAtIndex:0]; return [documentDirectory stringByAppendingPathComponent:@"levelconfig.plist"]; } -(void) readPlist{ NSString *filePath = [self dataFilePath]; if([[NSFileManager defaultManager]

Object serialization in XML format using Obj-C / iPhone SDK

霸气de小男生 提交于 2019-12-11 13:19:41
问题 I have an iPhone App that uses a relatively small amount of data. I'd like to save the data in the XML format and be able to load this in memory to Objective-C objects. I'd like to use iPhone SDK facilities like NSPropertyListSerialization or writeToFile:atomically: classes and methods. The NSPropertyListSerialization documentation says that The NSPropertyListSerialization class provides methods that convert property list objects to and from several serialized formats. Property list objects

How to automate MAMP Pro virtual host creation through a command-line shell script?

放肆的年华 提交于 2019-12-11 11:51:53
问题 I'm writing a script to create virtual hosts in Mamp Pro. I want them to be created and appear in the GUI next to the normal ones I've created manually through the GUI. I've found the following questions on SO: Automatic Virtual Hosts with MAMP Pro? Add MAMP Pro Vhosts with script Here are my findings, so far: I've found out that the hosts appearing in the MAMP Pro GUI are found in: ~/Library/Application\ Support/appsolute/MAMP\ PRO/settings3.plist ; I've tried editing it but I can't seem to

My mac osx launched plist won't run

僤鯓⒐⒋嵵緔 提交于 2019-12-11 11:41:49
问题 it looks like it loads but has a status of 1 when using launchctl list and using launchctl start ... it says No such Process... i have it saved in /Users/IMG/Library/LaunchAgents. The sh script runs fine. the logging doesn't show anything - no file created.. I am very new to plist so please forgive ignorance. <?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>Label</key

Set System Preferences using Objective-C

江枫思渺然 提交于 2019-12-11 11:08:31
问题 This is probably trivial, however I couldn't find any information online: How can I set any Apple preference using code? I would like to create a little application for myself that sets certain preferences when I click a button. For instance I would like to turn off Bluetooth and Wi-Fi. As far as I know, these preferences are stored in /Users/fabian/Library/Preferences/com.apple.*.plist . So: how can I change these preferences and make sure they are applied? 回答1: The CoreFoundation

Iterating over .plist dict. Type mismatch

≯℡__Kan透↙ 提交于 2019-12-11 11:07:48
问题 I am trying to iterate over nested dict from plist file. Problem is with type mismatch while decomposing contents. I always get errors that NSObject, NSDict and other NSstuff cannot be translated to String variables including when I use "(value)", string(), as .. How to decompose a plist dict sub sets tuple?(array) into separate variables? func LoadPlistContacts() { let path = NSBundle.mainBundle().pathForResource("ContactList", ofType: "plist") var AppContactsList = NSDictionary

Writing Textbox data to Plist

﹥>﹥吖頭↗ 提交于 2019-12-11 10:57:53
问题 I have a textbox with submit button . I need when i press to submit and data in the textbox should be written in the plist . I tried the below code , but nothing is been changing in the plist .I have created a plist with name sample.plist . -(void) SubmitAction { NSString *path = [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString *finalPath = [path stringByAppendingPathComponent:@"sample.plist"]; NSMutableDictionary *plistDict =

Saving/loading an array from plist file

二次信任 提交于 2019-12-11 09:49:56
问题 I'm creating 2 plist files in my documents directoy which I'd like to use for storing arrays. On the first run, while the files arent created yet everything works fine, items get saved into the arrays and then get written to one of the plist files I can check this in the documents dir. But when I have to read from the plist and then use it I get an EXC_BAD_ACCESS error. I have the following code: in viewDidLoad: NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,

Objective-C selectively populate table from plist; if key equals

删除回忆录丶 提交于 2019-12-11 08:42:14
问题 plist1 is an array of 40 dictionaries, with 4 strings each. plist2 is also an array, but of 120 dictionaries with 2 strings each. If I list all the teams in a hockey league in a table (populated from a certain key in plist1), say I choose the fifth one down. This pushes a new table. The 120 dictionaries in plist2 have two strings - each has one for a year of the league's history in order, and one for who won the championship that year. I want this second table to list only the years for which

Error while distributing app on air using dropbox

主宰稳场 提交于 2019-12-11 07:58:05
问题 I am using Enterprise certificate to distribute on air using dropbox following this link: http://aaronparecki.com/articles/2011/01/21/1/how-to-distribute-your-ios-apps-over-the-air While creating plist I used a dummy application URL and title i.e. https.....ipa, AppName resp. Both ipa and plist Uploaded on dropbox Used shared link of plist from dropbox and mention on HTML document I used HTML webpage/document shared link (replacing www.dropbox.com by dl.dropboxusercontent.com). But unable to