Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSColor Unable to be stored?



Hi all,

Although I'm fairly sure this question must've been answered before I can't
find the answer in either Apple's documentation or other sites, so I'm
afraid I'm going to have to ask one of those patented "Dumb Questions":

Is it impossibly to store a NSColor in memory? What I've done is basically
the following: I declared

NSColor *storedColor;

In an object's header file. Afterwards, I put the function:

storedColor = [NSColor colorWithDeviceRed:1.0 Green:1.0 Blue:1.0 Alpha:1.0];

in the object's init function (obviously not with those values,) and then
finally in the object's drawRect function:

[storedColor set];

Now this seems pretty simple to me, and I cannot for the life of me
understand why it won't work. I get an error saying "NCSFString -set:
selector not recognized" or something similar. Is this a special case, or am
I missing something obvious? Any help is appreciated.

-John S.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.