I am new to iPhone development. I want to know if there is any sample Objective-C code to create a plist at runtimeby getting data from a webserver and I want to know what the f
Very simple with a NSDictionary:
#define DOCUMENTS_PATH [NSSearchPathForDirectoriesInDomains(NSDocumentsDirectory, NSUserDomainMask, YES) objectAtIndex:0]
NSDictionary *myDictionary = [self parseWebResult];
// note that myDictionary must only contain values of string,
// int, bool, array (once again containing only the same types),
// and other primitive types (I believe NSDates are valid too).
[myDictionary writeToFile:[DOCUMENTS_PATH stringByAppendingPathComponent:@"myDict.plist"] atomically:YES];
// reading in the dictionary
myDictionary = [NSDictionary dictionaryWithContentsOfFile:[DOCUMENTS_PATH stringByAppendingPathComponent:@"myDict.plist"]];