--- On Fri, 8/15/08, dct <[EMAIL PROTECTED]> wrote:
> Both classes implement 'init' in like fashion
> (using different nibs
> and different NSView subclasses/connections):
>
> - init
> {
> [NSBundle
> loadNibNamed:@"SPlotWindow.nib" owner:self];
> [super
> initWithWindowNibName:@"SPlotWindow.nib"];
> [splotView initWithFrame:[splotView frame]];
> return self;
> }
I don't know if your trouble is related to this, but that init method is a
little messed up.
1. You shouldn't be performing any actions on an instance that hasn't been
initialized (as in the first line of that method) -- I think it will work
sometimes, but it's not particularly safe.
2. You shouldn't be calling init... methods on objects that haven't just been
alloced (as in the third line) -- or, alternatively, you shouldn't be asking an
object that hasn't been initialized for its frame (which is how the third line
would read if splotView had just been alloced).
3. You can't reliably message objects in a nib before -awakeFromNib.
It ought to be something along the lines of:
- (id)init
{
return [super initWithWindowNibName:@"SPlotWindow" owner:self])
}
- (void)awakeFromNib
{
[splotView setFrame:NSMakeRect(50,50,50,50)]; // or whatever you want the
frame to be
}
Cheers,
Chuck
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]