Skip navigation.
 
mlNeed help with warning: passing argument 1 of ... from distinct Objective C type
FROM : Jason Horn
DATE : Tue Nov 06 19:07:40 2007

I am getting a compiler warning that makes no sense to me:

warning: passing argument 1 of 'setImage:' from distinct Objective C 
type

My code is generating a CIImage and then passing it to a view object 
(VideoView) for drawing. As far as I can tell, the compiler is trying 
to tell me that the object (CIImage) that I am sending to the setImage 
method is of the wrong type.  But it looks right to me. Does anyone 
know what is going wrong here?

CIImage *resultImg;
CIFilter *sbcAdjust;
CIImage *ciImage = [CIImage alloc];
[ciImage initWithBitmapImageRep:bitmap];        
sbcAdjust = [CIFilter filterWithName:@"CIColorControls"];
[sbcAdjust setDefaults];
[sbcAdjust setValue:ciImage forKey:@"inputImage"];
[sbcAdjust setValue:[NSNumber numberWithFloat:brightness] 
forKey:@"inputBrightness"];
[sbcAdjust setValue:[NSNumber numberWithFloat:contrast] 
forKey:@"inputContrast"];
resultImg = [sbcAdjust valueForKey: @"outputImage"];
[videoView setImage:resultImg];

In the VideoView class, setImage is defined as follows:

- (void)setImage:(CIImage *)frameImage
{
   [frameImage retain];
   [image release];
   image = frameImage;
   [self setNeedsDisplay:YES];
}

Related mailsAuthorDate
mlNeed help with warning: passing argument 1 of ... from distinct Objective C type Jason Horn Nov 6, 19:07
mlRe: Need help with warning: passing argument 1 of ... from distinct Objective C type Nick Zitzmann Nov 6, 19:27