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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to