Read/Write on Plist file without using the iPhone SImulator?
- by Silent
Hello all,
i am using an example from the iphone developer book from apress. 
the problem is that this example only works on the simulator im trying to figure out how i can make it work on the device. This chapter isn't working at all. below is the sample code. data.plist is located in the resource folder.
    NSArray *paths  = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
return [documentsDirectory stringByAppendingPathComponent:kFilename];
Below then checks to see if the file is located. this is skipped, so im guessing this does not find the file.
if ([[NSFileManager defaultManager]fileExistsAtPath:filePath]) {
    NSArray *array = [[NSArray alloc] initWithContentsOfFile:filePath];
    BGDataSave = [array objectAtIndex:0];
    NSLog(@"%@", BGDataSave);
    price.text = [array objectAtIndex:1];
    percent.text = [array objectAtIndex:2];
    salepriceLabel.text = [array objectAtIndex:3];
    origpriceLabel.text = [array objectAtIndex:4];
}