Ios viewcontroller中的Cocos2d 2.1无法添加精灵

Ios viewcontroller中的Cocos2d 2.1无法添加精灵,ios,objective-c,cocos2d-iphone,Ios,Objective C,Cocos2d Iphone,我有一个视图控制器,我添加了一个glView,然后我简单地在场景中添加了大约100个精灵进行测试,在这行代码中出现了一个错误,这适用于任何设备中的ios 6和7,使用xcode 5编译 /** Appends an object. Bahaviour undefined if array doesn't have enough capacity. */ void ccArrayAppendObject(ccArray *arr, id object) { arr->arr[arr-

我有一个视图控制器,我添加了一个glView,然后我简单地在场景中添加了大约100个精灵进行测试,在这行代码中出现了一个错误,这适用于任何设备中的ios 6和7,使用xcode 5编译

/** Appends an object. Bahaviour undefined if array doesn't have enough capacity. */
void ccArrayAppendObject(ccArray *arr, id object)
{
    arr->arr[arr->num] = CC_ARC_RETAIN(object); <-- bad access
    arr->num++;
}
这就是我在现场看到的

+(CCScene *) scene
{
    CCScene *scene = [CCScene node];

    for (int i =0; i < 100; i++) {

        CCSprite  *bowSprite = [CCSprite spriteWithFile:@"icon_clock.png"];

        bowSprite.position = ccp(200,  200);

        [scene addChild:bowSprite];
    }


return scene;
}
如果有人有任何线索,这将是非常有用的


提前谢谢

你能确保[CCSprite spriteWithFile:@icon\u clock.png]没有返回nilHi Kevin吗,谢谢你的回答,但我认为返回的sprite非常好,因为如果我只添加一个,就没有问题,只有在添加5个以上时才会发生,谢谢!
+(CCScene *) scene
{
    CCScene *scene = [CCScene node];

    for (int i =0; i < 100; i++) {

        CCSprite  *bowSprite = [CCSprite spriteWithFile:@"icon_clock.png"];

        bowSprite.position = ccp(200,  200);

        [scene addChild:bowSprite];
    }


return scene;
}