Weird Compiler WARNING... help?
Hi.
IF I have the following code, everything compiles fine - no errors, no warnings.
However, if I add this one line below the NSLog line...
So the method looks like this
then I get the following compiler WARNING...
warning: passing argument 1 of 'locationInView:' from distinct Objective -C type
I can't work out why... what am I missing?
The method that's being called is this:
IF I have the following code, everything compiles fine - no errors, no warnings.
Code:
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event withView:(UIResponder *)receivingView
{
for (UITouch * touch in touches)
{
CGPoint point = [touch locationInView:receivingView];
_numberOfActiveTouches++;
NSLog(@"Active Touches = %i, Touch at : %f",_numberOfActiveTouches, point);
}
}However, if I add this one line below the NSLog line...
Code:
[self touchDownDetected:point];So the method looks like this
Code:
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event withView:(UIResponder *)receivingView
{
for (UITouch * touch in touches)
{
CGPoint point = [touch locationInView:receivingView];
_numberOfActiveTouches++;
NSLog(@"Active Touches = %i, Touch at : %f",_numberOfActiveTouches, point);
[self touchDownDetected:point];
}
}then I get the following compiler WARNING...
warning: passing argument 1 of 'locationInView:' from distinct Objective -C type
I can't work out why... what am I missing?
The method that's being called is this:
Code:
- (void) touchDownDetected:(CGPoint) point
{
// Blah blah blah
}
Fixed it... Grrrr...
replaced the (UIResponder *) with (UIView *)
and it's all good.
Sorry.
replaced the (UIResponder *) with (UIView *)
and it's all good.
Sorry.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Curious Compiler Issue? | WhatMeWorry | 1 | 2,193 |
Jan 16, 2007 03:52 PM Last Post: OneSadCookie |
|
| compiler (pre-processing?) error of SDL project | WhatMeWorry | 2 | 2,601 |
Oct 14, 2005 09:09 PM Last Post: WhatMeWorry |
|
| weird compiler warnings/errors in Xcode 2.0 | Andrew | 15 | 6,105 |
May 13, 2005 01:07 AM Last Post: Andrew |
|
| C# on a mac (warning: could scare small children) | inio | 14 | 5,353 |
Feb 1, 2003 04:05 AM Last Post: Taxxodium |
|

