Hey guys, trying to add (object?) to a my plist programmatically, heres what I've cooked out so far:
NSString *documentsDirectory = [[NSString alloc] initWithString:[[[[NSBundle mainBundle] resourcePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"Documents/myfolder"]];
NSString *writablePath = [documentsDirectory stringByAppendingPathComponent:@"Favourites.plist"];
NSMutableDictionary *rootDict = [[NSMutableDictionary alloc] initWithContentsOfFile:writablePath];
[rootDict setValue:@"My Third PDF" forKey:@"Title"];
[rootDict writeToFile:writablePath atomically: YES];
and heres my plist:
<plist version="1.0">
<dict>
<key>Rows</key>
<array>
<dict>
<key>SaveName</key>
<string>first.pdf</string>
<key>Title</key>
<string>My first PDF</string>
</dict>
<dict>
<key>SaveName</key>
<string>second.pdf</string>
<key>Title</key>
<string>My Second PDF</string>
</dict>
</array>
</dict>
</plist>
How do I go about adding another (object?) like
<dict>
<key>SaveName</key>
<string>third.pdf</string>
<key>Title</key>
<string>My third PDF</string>
</dict>
to my plist? Thanks!