Re: Crash while getting the NSColor components
Re: Crash while getting the NSColor components
- Subject: Re: Crash while getting the NSColor components
- From: Chris Suter <email@hidden>
- Date: Wed, 21 Jun 2006 15:50:42 +1000
On 21/06/2006, at 3:41 PM, Vinay Prabhu wrote:
I have found out the cause for the crash,
Before I call the method, where it was crashing,
I was manipulating the color of the iVar colorOfPanelSolid.
This is how the code is,
float red, green, blue, alpha;
float redEdit = [sender floatValue]/255; // divide by 255 is
because the
text field will take values from 0 to 255
currentColor = [activeColorWell color];
[currentColor getRed:&red green:&green blue:&blue alpha:&alpha];
editedColor = [NSColor colorWithCalibratedRed:redEdit green:green
blue:blue
alpha:alpha];
colorOfPanelSolid = editedColor;
If the value's of redEdit and red is same, afterwards when I execute
[colorOfPanelSolid getRed:&red green:&green blue:&blue alpha:&alpha];
Application crashes.
I suppose it should not crash in the above condition...
I haven't fully followed this thread. You're not doing something
silly like forgetting a retain are you? You realise
colorWithCalibratedRed:green:blue: returns an autoreleased object?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden