Permalink
Browse files

Log error if directory creation fails

  • Loading branch information...
1 parent 95f2376 commit ad714db0e871af53749bb93b637eec02810c2481 @0xced committed Sep 9, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 Classes/AppDelegate.m
View
@@ -94,7 +94,12 @@ - (NSString *) saveDirectory:(NSString *)subDirectory
saveDirectory = [saveDirectory stringByAppendingPathComponent:subDirectory];
if (![[NSFileManager defaultManager] fileExistsAtPath:saveDirectory])
- [[NSFileManager defaultManager] createDirectoryAtPath:saveDirectory withIntermediateDirectories:YES attributes:nil error:NULL];
+ {
+ NSError *error = nil;
+ BOOL created = [[NSFileManager defaultManager] createDirectoryAtPath:saveDirectory withIntermediateDirectories:YES attributes:nil error:&error];
+ if (!created)
+ NSLog(@"%@\n%@", error, error.userInfo);
+ }
return saveDirectory;
}

0 comments on commit ad714db

Please sign in to comment.