compiler assumes pointer, but its a float
compiler assumes pointer, but its a float
- Subject: compiler assumes pointer, but its a float
- From: crucial felix <email@hidden>
- Date: Thu, 5 Dec 2002 00:02:01 -0500
Hi,
I'm translating some stuff from a smalltalk implementation.
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
i tried including APlayer.h, but there's no way to tell it that its
really going to get a float.
besides refactoring so that each view class gets its own typed model
variable, is there a solution ?
[self model]
thanks. the archives have been helpful to search through.
also, is there a way to get the compiler to not warn about args to
class methods hiding instance variables ?
i do like the compile time checking though :)
-felix
_______________________________________________
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.