title: CGRectIntersectsRect
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6696393/cgrectintersectsrect-problem">CGRectIntersectsRect Problem</a>  </p>
  </blockquote>
  
  
  
  <p>I am making a app with a maze, I put a ball inside the maze in the interface builder (I put an outlet for it) I have a touchesMoved:</p>
  
  <pre><code>-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
      UITouch *touch = [[event allTouches] anyObject];
      CGPoint point;
      point = [touch locationInView:self.view];
  
      ball.center = point;
  
      if (CGRectIntersectsRect(ball.frame, maze.frame)) {
         //my stuff
      }
  }
  </code></pre>
  
  <p>I have two CGRectIntersectsRect if statements, I say, if the ball's frame touches the maze's frame, then // my stuff happens, but for some reason, whenever i try to move the ball, without touching the frame of the maze, // my stuff happens. I dont know why, maybe it is because the ball is IN the maze, probably not because i said if cgrectintersectsrect frame not bounds. so why is this happening?</p>