Re: -(NSString *)description method not called in Cocoa app
Re: -(NSString *)description method not called in Cocoa app
- Subject: Re: -(NSString *)description method not called in Cocoa app
- From: "M. Uli Kusterer" <email@hidden>
- Date: Mon, 20 Dec 2004 16:32:11 +0100
At 21:15 Uhr -0800 19.12.2004, Brian Andresen wrote:
If I call [obj description] on the object just after it's been alloc'd
and init'd, the description comes out right (...) But I do the same
thing at some point later,
and it comes out with the generic answer. It does say "MyObject" not
"NSObject" when it writes the description and memory address... I
don't know if that's worth anything.
Brian,
this sounds suspiciously like the OS is letting you get away with
accessing an already-(auto)released object. Make sure you're
retaining your objects correctly.
Most command-line apps only have one autorelease pool in their main
routine, while Cocoa apps get one from NSApp that is created and
released each time through the event loop.
So, very likely, your objects are "pending for release" in the
command-line tool, while in the Cocoa app, they have already been
released. You're just "lucky" that your bug doesn't show up in the
command-line tool, while in Cocoa you actually *notice* that the
rug's been pulled from under your feet.
Could that be your problem?
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden