Why doesn't this work?
// spriteArray is an NSMutableArray
int spriteWidth = [spriteArray objectAtIndex:0].contentSize.width;
I get the error:
Request for memeber 'contentSize' in something not a structure or union
If I change the code:
CCSprite *tempSprite = [spriteArray objectAtIndex:0];
int spriteWidth = tempSprite.contentSize.width;
Then it's okay.
I've tried casting:
int spriteWidth = (CCSprite*)[spriteArray objectAtIndex:0].contentSize.width;
But it doesn't work either.
Is there a way to do this without creating the sprite reference?