Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
I am getting this error message and it makes no sense. I am giving it what it needs?

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];
                }

            }
        }
 
O jezz, I knew that. It was a simple mistake. Time to step away from the computer and go for a walk.

Thanks.

-Lars
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.