defining NSColor constants
defining NSColor constants
- Subject: defining NSColor constants
- From: Arie Pieter Cammeraat <email@hidden>
- Date: Thu, 6 Aug 2009 08:58:47 +0200
In my app, I use several colors many times. I'd like to define them
in a separate file or class.
Is there another way to do this than:
#define kNiceBlueColor [NSColor colorWithRed: 20 green: 20 blue: 240
alpha:1];
I would like a more obj-c style, like
globals.h:
extern NSColor * const kNiceBlueColor
globals.m:
#import globals.h
NSColor * const kNiceBlueColor = [NSColor colorWithRed: 20 green: 20
blue: 240 alpha:1];
I found some examples of this kind for defining a NSString using the
@"foo"-syntax. With NSColor, it doesn't seem to work. I get the error
"initializer element is not constant". Anyone any thoughts on this?
Thanks in advance!
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden