[MacRuby-devel] Elegant initialization

Josh Voigts joshvoigts at gmail.com
Wed Apr 18 20:44:49 PDT 2012


Hey, first post to the list, woot!

I've run into a little bit of a snag. Is there an elegant way of
building an initializer similar to this one in macruby? (assuming I'm
subclassing an NSView object)


- (id)initWithFrame:(NSRect)frame controller:(AppController *)ctrlr
{
    if (self = [super initWithFrame:frame]) {
        controller = ctrlr; // deliberately weak reference.
    }

    return self;
}


More information about the MacRuby-devel mailing list