This is the code i have. The NSDictionary did used to be something, but i’ve temporarily removed that, when trying to find the problem.
NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Entries/"];
NSFileManager *fileManager = [NSFileManager defaultManager];
BOOL isDirectory = NO;
BOOL directoryExists = [fileManager fileExistsAtPath:path isDirectory:&isDirectory];
if (!directoryExists) {
[fileManager createDirectoryAtPath:path withIntermediateDirectories:NO attributes:nil error:nil];
}
if ([self.pathName isEqualToString:@""] || self.pathName == nil) {
self.pathName = [NSString stringWithFormat:@"%@.JEntry", [JMedia generateUuidString]];
}
NSString *entryPath = [path stringByAppendingPathComponent:self.pathName];
NSDictionary *dictionary;
NSLog(@"entrypath: %@", entryPath);
BOOL success = [dictionary writeToFile:entryPath atomically:YES];
NSLog(@"success: %i", success);
NSLog:
entrypath: /var/mobile/Applications/1B838285-8326-427A-8AC5-0D5567C3CD81/Documents/Entries/70AFCF6D-540E-436E-9989-68793500E35B.JEntry
success: 0
The problem might be that
dictionarycontains items that are not property list objects as the documentaion says: