mirror of https://github.com/axmolengine/axmol.git
Update cocos2dx/platform/ios/CCFileUtils.mm
fixing cannot read data using CCArray::createWithContentsOfFile
This commit is contained in:
parent
216a47ab1b
commit
cb66f1673e
|
@ -247,10 +247,13 @@ CCDictionary* ccFileUtils_dictionaryWithContentsOfFileThreadSafe(const char *pFi
|
||||||
|
|
||||||
CCArray* ccFileUtils_arrayWithContentsOfFileThreadSafe(const char* pFileName)
|
CCArray* ccFileUtils_arrayWithContentsOfFileThreadSafe(const char* pFileName)
|
||||||
{
|
{
|
||||||
NSString* pPath = [NSString stringWithUTF8String:pFileName];
|
// NSString* pPath = [NSString stringWithUTF8String:pFileName];
|
||||||
NSString* pathExtension= [pPath pathExtension];
|
// NSString* pathExtension= [pPath pathExtension];
|
||||||
pPath = [pPath stringByDeletingPathExtension];
|
// pPath = [pPath stringByDeletingPathExtension];
|
||||||
pPath = [[NSBundle mainBundle] pathForResource:pPath ofType:pathExtension];
|
// pPath = [[NSBundle mainBundle] pathForResource:pPath ofType:pathExtension];
|
||||||
|
// fixing cannot read data using CCArray::createWithContentsOfFile
|
||||||
|
const char* pszFullPath = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(pFileName);
|
||||||
|
NSString* pPath = [NSString stringWithUTF8String:pszFullPath];
|
||||||
NSArray* pArray = [NSArray arrayWithContentsOfFile:pPath];
|
NSArray* pArray = [NSArray arrayWithContentsOfFile:pPath];
|
||||||
|
|
||||||
CCArray* pRet = new CCArray();
|
CCArray* pRet = new CCArray();
|
||||||
|
|
Loading…
Reference in New Issue