Preferences window paradigm

In this post I will introduce you my preferences window approach :) For sure is not the only one you will come across, but is definitely one of the easiest ways. In this case the toolbar is created with Interface Builder so is compatible only with 10.5 or later. (less code)

So let’s start…

STEP #1 Preferences window controller

Click here to read more »

Separate nibs/xibs Part 2

Following the previous post that I explained you why you are encouraged to separate your nib/xib files now I am going to explain you how to do it.

STEP #1 The window controller

First we need to create the window controller (NSWindowController) :)  The header file AboutWindowController.h

#import <cocoa /Cocoa.h>
@interface AboutWindowController : NSWindowController { }
@end</cocoa>

And the implementation file AboutWindowController.m

#import "AboutWindowController.h"
@implementation AboutWindowController
- (id)init {
	if ((self = [super initWithWindow:NULL]) != NULL) {}
	return self;
}
- (NSString *)windowNibName {
	return NSStringFromClass([self class]);
// This determines the name of the Xib file, In this case the name
// of the class, so we need to create the AboutWindowController.xib
}
@end

STEP #2 Create the Xib

Now, with Interface Builder we need to add a new Application Xib and name it “AboutWindowController”. Step 1 Step 2

Click here to read more »