Re: NSColorWell and NSColor Category
Re: NSColorWell and NSColor Category
- Subject: Re: NSColorWell and NSColor Category
- From: Yann Bizeul <email@hidden>
- Date: Thu, 28 Aug 2003 13:05:32 +0200
It seem to be a beta dev tools issue (Panther), because if I comment my
category, the same error occurs if the NSColorWell is connected in IB.
Worth, 7B49 dev tools acts as if no autorelease pool is created (lot of
_NSAutoreleaseNoPool(): Object 0x3268b0 of class NSCFString
autoreleased with no pool in place - just leaking in console)
So I wait !
Thanks for your answer !
--
Yann Bizeul
TYNSOE.ORG -
http://www.tynsoe.org/
Site technique consacri ` MacOS X
Projets :
http://projects.tynsoe.org/
On 27 ao{t 03, at 16:26, Jonathan E. Jackel wrote:
I'm trying to write a category to NSColor to get a dictionary
reprentation of a color.
My problem is that works fine If I call my category on a newly
allocated color like [ NSColor blackColor ] but not on the color I get
from [ myColorWell color ].
What happens? Have you tried NSLogging calls to your method? Is your
method being called at all?
I suspect your method is being called, but that you may be asking the
colorwell color for information that doesn't exist in its colorspace.
You'll need to test for that. Check the "Using Color" documentation
for
details.
By the way, how do you know whether [NSColor blackColor] is "newly
allocated"? It could be implemented as a single shared instance. I
think
this misunderstanding may have caused you to misdiagnose the problem.
Is there a specific place where I have to declare my Category ?
Just import the category's .h file into the .m file where you use
category
methods. Sounds like you've done that.
Perhaps my NSColor already exists in memory (shared, into
NSColorPicker) and my category is ignored ?
No, it doesn't work that way. Every NSColor object should respond to
your
method.
Another solution could be to quickly copy a color with
something like
[ NSColor colorWithColor: myColor ] but that does not seem to be
possible.
newColor = [[myColor copy] autorelease];
Jonathan
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.