Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dbrayford

macrumors member
Original poster
Feb 22, 2010
41
0
I am getting several compiler warnings in the form of

Code:
warning: 'NSOpenGLView' may not respond to '-UpdateGraph'

but don't know how to fix them.
The header file is as follows

Code:
@interface RegressionView : NSOpenGLView
{
	IBOutlet NSTextField *rightcubesize;
	IBOutlet NSTextField *rightintersections;
	IBOutlet NSTextField *leftcubesize;
	IBOutlet NSTextField *leftintersections;
	IBOutlet NSTextField *selectedcubesize;
	IBOutlet NSTextField *selectedintersections;
	IBOutlet NSTextField *regM;
	IBOutlet NSTextField *regB;
	
	
	CenterPointList *cpl;
	int *cp;		// center point #
	int selected;	// index of point for which to display info
	float xmin, xmax, ymin, ymax;
	float w, h;			// width and height of window;
}

- (void) UpdateGraph;
- (void) setPointerAndScale: (CenterPointList *) cpl0: (int *) cp0: (float *) x0: (float *) x1: (float *) y0: (float *) y1;
 

jiminaus

macrumors 65816
Dec 16, 2010
1,449
1
Sydney
What's the type of the variable at the lines where you get this warning? Is it NSOpenGLView * or RegressionView *?

[Drinks coffee and then comes back to explain]

If the variable the type of the variable where these warnings are occurring is NSOpenGLView * then the warning is valid, because only if the object being pointed to is actually a RegressionView instance will it respond to the UpgradeGraph message.

The easiest way to silence the message would be type cast the variable to RegressionView * before or in the message send. For example:

Code:
[(RegressionView *)viewVariable UpdateGraph];

This is assuming you know for sure that viewVariable does point to a RegressionView instance.

BTW Typical Objective-C style would name the message updateGraph and not UpgradeGraph.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.