Re: [Pyobjc-dev] Subclassing in Interface Builder
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2003-02-21 16:51:51
|
On Friday, Feb 21, 2003, at 11:45 US/Eastern, Just van Rossum wrote: >> class MyImageView(AutoBaseClass): >> def initWithFrame_(self, frame): >> self = NSImageView.initWithFrame_(self, frame) >> print "never gets here" >> return self >> >> Has anyone seen this before? > > I'm just guessing, but perhaps you need to override awakeFromNib > instead? Right. This is one of the more subtle aspects of IB based programming. The objects are archived within the NIB and, upon nib loading, are reconstituted from the archive, not instantiated. Hence, the designated initializer will not be called. -awakFromNib is one possibility -- very useful because all connections have been made. I beliver this is also an initWithCoder: or something like it that can be used earlier. b.bum |