Skip navigation.
 
mlRe: -(NSString *)description method not called in Cocoa app
FROM : M. Uli Kusterer
DATE : Mon Dec 20 16:32:11 2004

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

Related mailsAuthorDate
ml-(NSString *)description method not called in Cocoa app Brian Andresen Dec 20, 04:09
mlRe: -(NSString *)description method not called in Cocoa app The Karl Adam Dec 20, 05:03
mlRe: -(NSString *)description method not called in Cocoa app Brian Andresen Dec 20, 06:15
mlRe: -(NSString *)description method not called in Cocoa app Chris Giordano Dec 20, 16:24
mlRe: -(NSString *)description method not called in Cocoa app M. Uli Kusterer Dec 20, 16:32
mlRe: -(NSString *)description method not called in Cocoa app Brian Andresen Dec 20, 23:37