In Obj-C, I typically subclass NSWindowController and override -init to call 
-initWithNibName:. I do this so the caller doesn't have to worry about how to 
make one of these window controllers:

@implementation MyWindowController

- (id) init
{
    self = [super initWithWindowNibName: "MyWindow" owner: self]
    ...
    return self;
}

I can't figure out how to do the same in Swift. NSWindowController makes 
initWithWindow() the only designated initializer, which I must call, which 
makes it seem like I can't use any of the convenience methods. Apple's own 
guidance on designated inititalizers is that they should be the ones that take 
the most parameters.

So, I can load the nib myself, and make the window, and pass that up, but this 
seems broken. Is it?

-- 
Rick Mann
rm...@latencyzero.com



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to