my problem is that im making a web browser for iPhone/iPad and i tested the bookmarked system and the tableview plist data updates when adding a bookmark. It works on the simulator side But when i tested the app using my iPhone it does not show the updates tableview I did add some data via xcode to the plist and the data i added shows up on the iPhone but still does not update to show new entries that you enter via app the plist file is called "bookmarks.plist" whats the problem ?
Here the code that writes to bookmarks.plist
NSFileManager *fileManager = [NSFileManager defaultManager];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentDirectory = [paths objectAtIndex:0];
NSString *plistPath = [documentDirectory stringByAppendingPathComponent:@"bookmarks.plist"];
if (![fileManager fileExistsAtPath:plistPath]) {
plistPath = [[NSBundle mainBundle] pathForResource:@"bookmarks" ofType:@"plist"];
//[[NSFileManager defaultManager] copyItemAtPath:plistPath toPath:plistPath error:NULL];
}
NSMutableArray *dataRoot = [NSMutableArray arrayWithContentsOfFile:plistPath];
NSMutableDictionary *item = [[NSMutableDictionary alloc] init];
[item setObject: _titleField.text forKey:@"title"];
[item setObject:_urlField.text forKey:@"url"];
[dataRoot addObject:item];
[dataRoot writeToFile:plistPath atomically:YES];