On 19 Oct 2014, at 2:25 pm, Rick Mann <rm...@latencyzero.com> wrote:
> In an NSWindowController subclass init method, I want to call > -loadNibNamed:owner:topLevelObjects, but that requires I have a bundle. I can > get the main bundle, but I'd rather get the bundle for this class (makes it > useable in unit tests). > > But, inside an init method, I'm not allowed to reference self until > super.init is called. So, how do I do this? I think my other reply will make this a moot point, but since [NSBundle bundleForClass:] takes a Class, and you know what your class is, just pass it that, you don't have to reference self. [NSBundle bundleForClass:[MyGroovySubclass class]]; --Graham _______________________________________________ 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