RE: Crash while getting the NSColor components
RE: Crash while getting the NSColor components
- Subject: RE: Crash while getting the NSColor components
- From: Vinay Prabhu <email@hidden>
- Date: Wed, 21 Jun 2006 12:02:05 +0530
- Importance: Normal
My observation here is if the values of the var's
red and redEdit are different, it doesn't crash.
If the values of the red and redEdit is same it will crash.
If the crash is because of missing retain, it should crash in both the
cases...
Am I right?
-----Original Message-----
From: Chris Suter [mailto:email@hidden]
Sent: Wednesday, June 21, 2006 11:21 AM
To: Vinay Prabhu
Cc: 'Corbin Dunn'; email@hidden
Subject: Re: Crash while getting the NSColor components
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?
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s)and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender or email@hidden
_______________________________________________
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