Re: Custom View initialization: where?

2008-05-02 Thread Scott Anguish
On May 2, 2008, at 10:49 PM, Graham Cox wrote: - (id)initWithFrame:(NSRect)frame; BTW: you don't need to declare methods in @interface that are inherited from the superclass. True. However, it is often useful to do that when you subclass so you can tell just by looking at the headers

Re: Custom View initialization: where?

2008-05-02 Thread Markus Spoettl
On May 2, 2008, at 8:23 PM, Quincey Morris wrote: I don't know why initWithFrame: isn't being called in your case, but someone from Apple did say on this list a few weeks ago that an initializer *is* always called. If it's not initWithFrame:, it will be initWithCoder:. Presumably that is g

Re: Custom View initialization: where?

2008-05-02 Thread Andy Lee
The doc I found says there are *two* ways a custom view is initialized. One uses initWithFrame:, the other doesn't. Are you sure your case is the first case? It sounds like it, but I thought I'd double-check.

Re: Custom View initialization: where?

2008-05-02 Thread Quincey Morris
On May 2, 2008, at 19:05, Markus Spoettl wrote: Following the "View Programming Guide for Cocoa" if I use a Custom- View proxy in IB, the view's initWithFrame: method will be called when the NIB is loaded (this can be found in "Initializing View Instances Created in Interface Builder"). I

Re: Custom View initialization: where?

2008-05-02 Thread Graham Cox
On 3 May 2008, at 12:34 pm, Markus Spoettl wrote: The view is instantiated correctly because it draws right. When I put the debugger breakpoint in initWithFrame: it doesn't get called. Is there something wrong with this? No, not that I can see. Maybe you aren't actually running in the d

Re: Custom View initialization: where?

2008-05-02 Thread Markus Spoettl
On May 2, 2008, at 7:11 PM, Graham Cox wrote: Sounds OK - so post your code. The documentation is correct. Well the code is totally straight forward: @interface MyView : NSView { MyObjectData *data; } @property (readonly) MyObjectData *data; - (id)initWithFrame:(NSRect)frame; @end @i

Re: Custom View initialization: where?

2008-05-02 Thread Graham Cox
Sounds OK - so post your code. The documentation is correct. G. On 3 May 2008, at 12:05 pm, Markus Spoettl wrote: Following the "View Programming Guide for Cocoa" if I use a Custom- View proxy in IB, the view's initWithFrame: method will be called when the NIB is loaded (this can be found i

Custom View initialization: where?

2008-05-02 Thread Markus Spoettl
Following the "View Programming Guide for Cocoa" if I use a Custom- View proxy in IB, the view's initWithFrame: method will be called when the NIB is loaded (this can be found in "Initializing View Instances Created in Interface Builder"). I do have a custom NSView derived view and a simple