Skip navigation.
 
mlRe: Totally confused: NSObject not init'ing
FROM : Shawn Erickson
DATE : Wed Dec 01 20:44:17 2004

On Dec 1, 2004, at 7:51 AM, Michael Becker wrote:

> Hey!
>
> Okay, this one almost scares me! What the heck is wrong here? I have
> an NSObject subclass (PCProductsOrder) and an NSWindowController
> subclass (PCProductsOrderController). The controller wants to create
> an instance of the NSObject subclass.
> Here's the code:
>
> - (id)init {
>     self = [ super initWithWindowNibName:@"ProductsOrder"];
>     if (self) {
>         NSLog(@"initializing");
>         order = [[ PCProductsOrder alloc] init];
>         NSLog(@"order: %@", order);
>     }
>     return self;
> }
>
> I put an NSLog into PCProductsOrder's init-method (which doesn't do
> anything special) and it's obviously never called. The output of the
> above method is the following:
>
> 2004-12-01 16:46:47.555 PhotoClient3[1008] initializing
> 2004-12-01 16:46:47.555 PhotoClient3[1008] order: (null)
>
> There are no compile-time errors or warnings, to my eyes everything
> looks alright. What could be the cause of this?


What does your PCProductsOrder init method do? It sure looks like it is
return nil or not what it should be.

Have you tried using the debugger to walk thru your code while it runs?

-Shawn

Related mailsAuthorDate
mlTotally confused: NSObject not init'ing Michael Becker Dec 1, 16:51
mlRe: Totally confused: NSObject not init'ing John Stiles Dec 1, 20:32
mlRe: Totally confused: NSObject not init'ing Steve Bird Dec 1, 20:36
mlRe: Totally confused: NSObject not init'ing Amul Goswamy Dec 1, 20:43
mlRe: Totally confused: NSObject not init'ing Shawn Erickson Dec 1, 20:44
mlRe: Totally confused: NSObject not init'ing Guy English Dec 1, 20:45
mlRe: Totally confused: NSObject not init'ing Erik M. Buck Dec 1, 21:26
mlRe: Totally confused: NSObject not init'ing Guy English Dec 1, 22:11
ml[SOLVED] Re: Totally confused: NSObject not init'ing Michael Becker Dec 2, 16:11