Hi,
I can't copy plist into the Documents folder.
Here is a code I developed:
Could you please find the issue?
Thanks
I can't copy plist into the Documents folder.
Here is a code I developed:
PHP:
NSBundle *bundle = [NSBundle mainBundle];
NSError *error = nil;
NSString *userSettingsPath = [bundle pathForResource:USER_SETTINGS_PLIST_NAME ofType:@"plist"];
NSFileManager *fileManager = [NSFileManager defaultManager];
// get "Documents" folder
NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryPath = [searchPaths objectAtIndex:0];
[fileManager copyItemAtPath:userSettingsPath toPath:documentsDirectoryPath error:&error];
Thanks