Re: instance management in IB

2009-05-12 Thread Jonathan Hess
On May 11, 2009, at 10:24 PM, Patrick Mau wrote: Hallo Chris The NIB loading guide states that custom objects, like your model object, are created using 'initWithCoder' and not plain 'init'. For many objects that is the case, but instances of Custom View and Custom Object will be

instance management in IB

2009-05-11 Thread Chris Carson
Hello, I've been scratching my head trying to get a basic delegate/data source Cocoa/AppKit program working and feel that I'm misunderstanding something basic (I've included the code is at the end). I set a breakpoint within the if statement in the init method of MyModel and see it called

Re: instance management in IB

2009-05-11 Thread Jonathan Hess
Hey Chris - This line pointPath = [NSBezierPath bezierPath]; in the init method creates an NSBezierPath instance that may (will!) be destroyed with the next autorelease pool flush. You should be creating your bezier path with pointPath = [[NSBezierPath alloc] init]; and then add a

Re: instance management in IB

2009-05-11 Thread Patrick Mau
Hallo Chris The NIB loading guide states that custom objects, like your model object, are created using 'initWithCoder' and not plain 'init'. I would advise you to implement 'awakeFromNib' in your view and use NSLog() to print your datasource and its buffer or simply to set a breakpoint

Re: instance management in IB

2009-05-11 Thread Chris Carson
Hi Jon, Thanks! That did the trick -- I was way off. Chris - Original Message From: Jonathan Hess jh...@apple.com To: Chris Carson cucar...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Tuesday, May 12, 2009 1:19:11 AM Subject: Re: instance management in IB Hey Chris