Re:compiler assumes pointer, but its a float
Re:compiler assumes pointer, but its a float
- Subject: Re:compiler assumes pointer, but its a float
- From: Bruce Veazie <email@hidden>
- Date: Fri, 6 Dec 2002 00:26:10 -0500
'model' points to a root class. Thus, the compiler expects a class
method such as
+(float)pchRatio;
The plus sign is crucial, felix.
Looks like 'model' should be a pointer to APlayer, not a pointer to a
root class.
Alternately, cast 'model' as 'APlayer' if it does, indeed, point to an
'APlayer.'
E.g., [(APlayer *)model pchRatio]
crucial felix wrote:
=======
I have AbstractPlayer and APlayer (subclass)
I have AbstractPlayerView and APlayerView (subclass)
each player class has a view class, and the view classes inherit
useful things from each other.
the abstract class has a variable
AbstractPlayer *model;
APlayer has a method which returns a float
-(float)pchRatio;
the problem:
in the APlayerView i attempt to get the pchRatio
[pchRatioSlider setFloatValue: (float)[model pchRatio]];
but the compiler complains:
APlayerView.m:33: warning: `AbstractPlayer' does not respond to
`pchRatio'
APlayerView.m:33: pointer value used where a floating point value was
expected
========
Bruce J. Veazie
email@hidden
http://veazie.org
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.