需要在App目录 Library/Caches 下创建新目录,
创建一个“Map” 目录
NSFileManager *manager = [NSFileManagerdefaultManager];
std::string cacheDirectory = CCFileUtils::sharedFileUtils()->getWriteablePath();
NSString * cachePath = [NSString stringWithCString:cacheDirectory.c_str() encoding:NSUTF8StringEncoding];
NSString * directory = [NSString stringWithUTF8String:"Map" ];
NSString *mapPath = [cachePath stringByAppendingPathComponent:directory];
//判断目录是否存在
if (![manager fileExistsAtPath:mapPath])
{
NSError *error;
BOOL a = [manager createDirectoryAtPath:mapPath withIntermediateDirectories:YESattributes:nilerror:&error];
}