Weird Compiler WARNING... help?

Member
Posts: 48
Joined: 2009.05
Post: #1
Hi.

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
}
Quote this message in a reply
Member
Posts: 48
Joined: 2009.05
Post: #2
Fixed it... Grrrr...

replaced the (UIResponder *) with (UIView *)

and it's all good.

Sorry.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Apple Match-O Linker Warning abuabhi 1 2,076 Sep 30, 2013 03:12 PM
Last Post: OneSadCookie
  Curious Compiler Issue? WhatMeWorry 1 2,452 Jan 16, 2007 03:52 PM
Last Post: OneSadCookie
  compiler (pre-processing?) error of SDL project WhatMeWorry 2 2,901 Oct 14, 2005 09:09 PM
Last Post: WhatMeWorry
  weird compiler warnings/errors in Xcode 2.0 Andrew 15 6,575 May 13, 2005 01:07 AM
Last Post: Andrew
  C# on a mac (warning: could scare small children) inio 14 6,324 Feb 1, 2003 04:05 AM
Last Post: Taxxodium