• 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: I'm having trouble retaining a NSColor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >I'm having trouble retaining a NSColor (From: "Alan Smith" <email@hidden>)
 >Re: I'm having trouble retaining a NSColor (From: "Shawn Erickson" <email@hidden>)
 >Re: I'm having trouble retaining a NSColor (From: "Alan Smith" <email@hidden>)
 >Re: I'm having trouble retaining a NSColor (From: Ricky Sharp <email@hidden>)
 >Re: I'm having trouble retaining a NSColor (From: "Alan Smith" <email@hidden>)

  • Prev by Date: Re: iTunes and AppleScript
  • Next by Date: Re: Contextual Menu doesn't respond to control+click
  • Previous by thread: Re: I'm having trouble retaining a NSColor
  • Next by thread: Re: I'm having trouble retaining a NSColor
  • Index(es):
    • Date
    • Thread