NSString *filePath = [[NSBundle mainBundle] pathForResource:@"words" ofType:@"txt"];
NSFileHandle *myHandle = [NSFileHandle fileHandleForUpdatingAtPath:filePath];
[myHandle seekToEndOfFile];
//the minus 17 puts it back far enough to be in the correct place for adding new values in the plist
unsigned long long loc = [myHandle offsetInFile] - 17;
[myHandle seekToFileOffset:loc];
NSString *theKey = [NSString stringWithString:@"1"];
NSString *theValue = [NSString stringWithString:@"one"];
NSMutableString *newKeyValuePair = [NSMutableString stringWithString:@"\t<key>"];
[newKeyValuePair appendString:theKey];
[newKeyValuePair appendString:@"<\key>\n\t<string>"];
[newKeyValuePair appendString:theValue];
[newKeyValuePair appendString:@"</string>\n</dict>\n</plist>\n];
NSData *theData = [newKeyValuePair dataUsingEncoding:NSUTF8StringEncoding];
[myHandle writeData:theData];
[myHandle closeFile];