Add error logging of incorrect directory creating.

This commit is contained in:
Бесшапошников Никита 2016-04-19 10:17:31 +03:00
parent e555ed5b9e
commit a3717b6907
1 changed files with 8 additions and 1 deletions

View File

@ -543,7 +543,14 @@ bool FileUtilsApple::createDirectory(const std::string& path)
NSError* error;
return [s_fileManager createDirectoryAtPath:[NSString stringWithUTF8String:path.c_str()] withIntermediateDirectories:YES attributes:nil error:&error];
bool result = [s_fileManager createDirectoryAtPath:[NSString stringWithUTF8String:path.c_str()] withIntermediateDirectories:YES attributes:nil error:&error];
if(!result && error != nil)
{
CCLOGERROR("Fail to create directory \"%s\": %s", path.c_str(), [error.localizedDescription UTF8String]);
}
return result;
}
NS_CC_END