Update cocos2dx/platform/ios/CCFileUtils.mm

fixing cannot read data using CCArray::createWithContentsOfFile
This commit is contained in:
Horcruxes 2012-09-27 12:31:53 +10:00
parent 216a47ab1b
commit cb66f1673e
1 changed files with 7 additions and 4 deletions

View File

@ -247,10 +247,13 @@ CCDictionary* ccFileUtils_dictionaryWithContentsOfFileThreadSafe(const char *pFi
CCArray* ccFileUtils_arrayWithContentsOfFileThreadSafe(const char* pFileName)
{
NSString* pPath = [NSString stringWithUTF8String:pFileName];
NSString* pathExtension= [pPath pathExtension];
pPath = [pPath stringByDeletingPathExtension];
pPath = [[NSBundle mainBundle] pathForResource:pPath ofType:pathExtension];
// NSString* pPath = [NSString stringWithUTF8String:pFileName];
// NSString* pathExtension= [pPath pathExtension];
// pPath = [pPath stringByDeletingPathExtension];
// 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];
CCArray* pRet = new CCArray();