I am getting this error message and it makes no sense. I am giving it what it needs?
When I add a UIImageView to the screen I add it as a used object to an NSMutableArray. Then I check to see if the objects collide with this for loop using fast enumeration. If there is a UIView frame collision I am creating a explosion UIImageView Animation. I am simply using the frame of the object on the view for the origin and size for the explosion animation. I should not be getting this error?
I also tried to typecast like so.
The code
Initializing 'CGRect *' (aka 'struct CGRect *') with an expression of incompatible type 'CGRect' (aka 'struct CGRect')
When I add a UIImageView to the screen I add it as a used object to an NSMutableArray. Then I check to see if the objects collide with this for loop using fast enumeration. If there is a UIView frame collision I am creating a explosion UIImageView Animation. I am simply using the frame of the object on the view for the origin and size for the explosion animation. I should not be getting this error?
I also tried to typecast like so.
Code:
CGRect *poofRect = (CGRect) userObject.frame;
The code
Code:
for (UIImageView *userObject in userDefenceObjects) {
if (CGRectIntersectsRect(cannonBallView1.frame, userObject.frame)) {
if (!col) {
col = [[Collisions alloc]init];
}
BOOL collision = [col checkAlphaAnimationCollision:cannonBallView1 withObj:userObject];
if (collision) {
[hitAudio play];
gameRunning = NO;
CGRect *poofRect = userObject.frame;
[userObject removeFromSuperview];
[cannonBallView1 removeFromSuperview];
NSLog(@"BANG");
[self performSelector:@selector(newGame) withObject:nil afterDelay:2];
}
}
}