• 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
compiler assumes pointer, but its a float
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: compiler assumes pointer, but its a float
      • From: Jeff Disher <email@hidden>
  • Prev by Date: Re: Getting started in Cocoa and IB
  • Next by Date: Re: using the GPL Quake code in a commercial game
  • Previous by thread: Re: NSToolbar and NSPopUpButton
  • Next by thread: Re: compiler assumes pointer, but its a float
  • Index(es):
    • Date
    • Thread