• 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: Mutable NSColor?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mutable NSColor?


  • Subject: Re: Mutable NSColor?
  • From: Ondra Cada <email@hidden>
  • Date: Mon, 24 Sep 2001 15:17:55 +0200

Rob,

>>>>>> Rob Rix (RR) wrote at Mon, 24 Sep 2001 08:29:48 -0400:
RR> >Why don't you just create a new (immutable) color to be used instead the
RR> >old one?
RR>
RR> Err...it would force me to make my API rather hackish. I'd go into more
RR> detail, but I just forgot it.

Come on. I guess that is a reason strong enough to redesign the API.

Or, if the worst came to the worst, what about this (unfinished and
untested) pattern:

@interface NSMutableColour /* ;))) */ : NSColor {
NSColor *colour;
}
-(void)changeSomething:something;
...
// all "normal" methods forwarded to colour
@end
@implementation NSMutableColour
...
-(void)changeSomething:something {
[colour autorelease];
colour=[[NSColor colorWith... colour... and... something...] retain];
}
...
@end
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc


  • Follow-Ups:
    • Re: Mutable NSColor?
      • From: Rob Rix <email@hidden>
  • Prev by Date: Re: multiline NSTextFields
  • Next by Date: Re: Mutable NSColor?
  • Previous by thread: Re: Mutable NSColor?
  • Next by thread: Re: Mutable NSColor?
  • Index(es):
    • Date
    • Thread