The first part of your code will not work, writing to the mainBundle is not possible since it is readonly on the device.
The seconds part may fail because the first part of your code is failing.
Just add this check in your code if the file is actually written:
// write back to file
if (![dict writeToFile:path atomically:YES]) {
NSLog:(@"Failed to write: %@", path);
}