-3
我得到这个错误:在此行For循环 - 表达式的结果未使用
Expression result unused
:
for(NSInteger i = 0; i lives; i++)
这是我的代码:
lives = 3;
heartArray = [ [NSMutableArray alloc] init];
for(NSInteger i = 0; i lives; i++)
{
CCSprite *heart = [CCSprite spriteWithFile:@"heart.png"];
[hearthArray insertObject:heart atIndex:i];
heart.position = ccp(((i+1)*50), winSize.height - 50);
[self addChild:hearth];
}
你的情况(我<生命)和'hearthArray addObject'似乎都很可疑。条件是完全错误的,我想'heartarray'应该是'heartArray'。 – n00bProgrammer