Re: I'm having trouble retaining a NSColor
Re: I'm having trouble retaining a NSColor
- Subject: Re: I'm having trouble retaining a NSColor
- From: Shawn Erickson <email@hidden>
- Date: Mon, 28 Aug 2006 18:13:32 -0700
On Aug 28, 2006, at 6:06 PM, Alan Smith wrote:
I will read those docs but the problem currently remains. What do you
mean by "accessors"?
Make your set method look exactly like the following and see if that
fixes your problem.
- (void)setHighlightColor:(NSColor*)color
{
if (color != highlightColor) {
[highlightColor release];
highlightColor = [color retain];
}
}
If color is nil and highlightColor isn't already nil then
highlightColor will be set to nil in the above because sending a
message to nil is a nop (no-operation) and if such a message returns
a object pointer it will return nil.
Anyway can you restate the problem you are hitting? It isn't clear to
me what remains the problem.
-Shawn
_______________________________________________
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