hello,
i would like to create a plist, then write and read <data></data> format for a key in the plist. The rest of keys are in string format.
The following code does what i want but it writes and reads all key in <string></string> instead of data format.
How can i get it to work?
Thanks!
write:
read:
i would like to create a plist, then write and read <data></data> format for a key in the plist. The rest of keys are in string format.
The following code does what i want but it writes and reads all key in <string></string> instead of data format.
How can i get it to work?
Thanks!
write:
PHP:
/* write plist */
NSString *plistPath = @"/Users/dova/Desktop/data.plist";
NSMutableDictionary *plistDict = [[NSMutableDictionary alloc] init];
[plistDict setObject:info forKey:@"name"];
...
[plistDict writeToFile:plistPath atomically:YES];
read:
PHP:
/* read plist */
NSString *plistPath = @"/Users/dova/Desktop/data.plist";
NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath];
NSData *value;
value = [plistDict objectForKey:@"name"];