有如下的代码,用字典元素初始化数组,xcode报错说创建数组时使用了无效的参数(这是我看的cocos2d的一个例子,要把它用cocos2d-x重新写一遍,后面附上了原来的oc代码)不知道该怎么解决,请高手指点
用cocos2d-x写的代码:
const char *path = CCFileUtils::sharedFileUtils()->fullPathFromRelativeFile(“preloadAssertManifest”, “plist”);
CCDictionary *manifest = CCDictionary::createWithContentsOfFile(path);
CCArray *spritesheets = CCArray::createWithObject(manifest->objectForKey("SpriteSheets"));
CCArray *images = CCArray::createWithObject(manifest->objectForKey("Images"));
CCArray *soundFX = CCArray::createWithObject(manifest->objectForKey("SoundFX"));
CCArray *music = CCArray::createWithObject(manifest->objectForKey("Music"));
CCArray *assets = CCArray::createWithObject(manifest->objectForKey("Assets"));
在cocos2d中有下面一段代码,用字典元素初始化数组:
NSString *path = fullPathFromRelativePath: @“preloadAssetManifest.plist”];
NSDictionary *manifest = ;
NSArray *spriteSheets = ;
NSArray *images = ;
NSArray *soundFX = ;
NSArray *music = ;
NSArray *assets = ;