I created a directory in the default user directory called "duel" with default attributes. Now i'm trying to delete that directory, but i get an error returned every time. I assume is a permissions issue, but i'm not sure. Does anyone know why and how to fix this? Any help would be much appreciated!
Path Output: /Users/admin/Library/Application Support/iPhone Simulator/User/Applications/3883E8F8-BEF5-47B5-8ED3-95A085EE7050/Documents/duel
Error Output: GameData:deleteAbilityData Error saving context: duel could not be removed.
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryPath = [paths objectAtIndex:0];
NSString *directory = [documentsDirectoryPath stringByAppendingPathComponent:@"duel"];
NSLog(directory);
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error;
if(![fileManager removeItemAtPath:directory error:&error]) {
NSLog(@"%@:%s Error saving context: %@", [self class], _cmd, [error localizedDescription]);
return;
}