• 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: pointer value into floating point value???HELP???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pointer value into floating point value???HELP???


  • Subject: Re: pointer value into floating point value???HELP???
  • From: Justin Anderson <email@hidden>
  • Date: Wed, 27 Aug 2003 21:06:58 -0400

Your error line 111 is in the last line, right? You're passing in pointers to floats instead of floats themselves like the -colorWithCalibratedRed:green:blue:alpha: requires.
I
'm not sure what else you're doing outside of this block of code, but I think what you want is:

float ws1R;
float ws1G;
float ws1B;

timerValue = [[dictws1 objectForKey: @"R"]retain];
ws1R = [timerValue intValue];
[timerValue release];

timerValue = [[dictws1 objectForKey: @"G"]retain];
ws1G = [timerValue intValue];
[timerValue release];

timerValue = [[dictws1 objectForKey: @"B"]retain];
ws1B = [timerValue intValue];
[timerValue release];

NSColor *col = [NSColor colorWithCalibratedRed:ws1R
green:ws1G blue:ws1B alpha:1.0];

Justin

On Wednesday, August 27, 2003, at 07:24 PM, Rhon Fitzwater wrote:

static float *ws1R;
static float *ws1G;
static float *ws1B;

ws1R = [timerValue intValue]; // this converts the string into an
integer// I tried it without this as well
ws1G = [[dictws1 objectForKey: @"G"]retain];
ws1G = [timerValue intValue]; // this converts the string into an
integer// I tried it without this as well
ws1B = [[dictws1 objectForKey: @"B"]retain];
ws1B = [timerValue intValue]; // this converts the string into an
integer// I tried it without this as well

NSColor *col = [NSColor colorWithCalibratedRed:(float)ws1R
green:(float)ws1G blue:(float)ws1B alpha:1.0];

I get this error when I build:
MyProgram.m:111: error: pointer value used where a floating point value
was expected

Is there a way to convery a pointer value to a floating point value.

I may be totally off on my thinking, but I hope you can do what I am
doing above.

Any suggestions on how to fix this?

Thanks,

-rhon
_______________________________________________
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.
_______________________________________________
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: pointer value into floating point value???HELP???
      • From: "Jonathan E. Jackel" <email@hidden>
References: 
 >pointer value into floating point value???HELP??? (From: Rhon Fitzwater <email@hidden>)

  • Prev by Date: NSViews and Distributed Objects
  • Next by Date: Re: NSViews and Distributed Objects
  • Previous by thread: Re: pointer value into floating point value???HELP???
  • Next by thread: RE: pointer value into floating point value???HELP???
  • Index(es):
    • Date
    • Thread