enemyBlobArray = [[NSMutableArray alloc] init];
for(int i = 0; i < kEnemyCount; i++) {
[enemyArray addObject:[SpriteHelpers setupAnimatedSprite:self.view numFrames:3 withFilePrefix:@"greenbox" withDuration:((CGFloat)(arc4random()%2)/3 + 0.5) ofType:@"png" withValue:0]];
}
enemyView = [enemyArray objectAtIndex:0];
I am trying to make objects appear on screen from this array.
I get an error message saying that the object I add cannot be nil
. I don't know why it's nil
, though.
[SpriteHelpers setupAnimatedSprite:numFrames:withFilePrefix:withDuration:ofType:withValue:]
(what a mouthful!) is returningnil
. We can't possibly help you without knowing what that method does!