• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re:compiler assumes pointer, but its a float
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Table View Menu Validation!?!?
  • Next by Date: Re: [repost] Using NSFontPanel in a prefPane ?
  • Previous by thread: Re: compiler assumes pointer, but its a float
  • Next by thread: How are you writing out XML?
  • Index(es):
    • Date
    • Thread