edit start : got this to work with the following:
Code:
if (CGRectContainsPoint([newGameView frame], [touch locationInView:self]))
Thanks anyone who even bothered to read my post ...

After pulling my hair out a bunch I found a method that worked. Turns out the CGRectIntersectsRect was not what was used in the video. Hope this helps other people. I bet it won't tho!!!! hahaha cause the video uses the right one! ... i don't know why I was using IntersectsRect.
end edit:
original question
I have been following this tutorial to get what I want working in my application and the following line of code is not working for me and returning an error
Code:
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
if (CGRectIntersectsRect([image1 frame], [touch locationInView:self])) {
//do stuff
}
return;
}
I get the following error:
incompatible type for argument 2 of 'CGRectIntersectsRect'
this is a link to the tutorial I was uses to get me started from Nitrex88:
Welcome to the iPhone Development Central Website!
I'm try to not use interface builder if at all possible and try to do everything programatically. What I am really try to do achieve the same thing as an icon on the main screen of the iphone does in a button.
What I mean is this and if you take any iPhone you can see this.
1. when you touch an icon it gets darker
2. if you drag off the icon it goes back to regular color
3. if you drag back on it gets darker again
4. if you drag off and release it does not launch action
5. if you drag back on and release it does launch action.
This is very basic rollover button animations and coding I want to achieve but i'm having a hell of a time figuring this out. Any help with this would be appreciated as I might just be going about this the wrong way.