Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

elindividuo123

macrumors newbie
Original poster
Mar 22, 2009
2
0
Hi. I'm trying to set up a .xib to load my preference panel and it's not happening. I'm not much of a programmer so I was following steps from Cocoa Programming For Mac OSX. The app builds just fine but the preference panel won't load. The tut was for a nib file but so far as I can tell XCode 3.1.2 only works with xib.

The console says:

2009-03-22 12:05:20.295 RaiseMan[4103:10b] -[PreferenceController loadWindow]: failed to load window nib file ':preferences'.

I have a .m file called PreferencesController and one called AppController.
I think this is all the relevant code. I also made some connections on the Interface Builder.
Preferences linked to AppController's showPreferencePanel action.
Panel title is Preferences

Here is my PreferenceController.m:

Code:
#import "PreferenceController.h"
@implementation PreferenceController

-(id) init
{
	if (![ super initWithWindowNibName:@":Preferences"])
		return nil;
	return self;
}

-(void)windowDidLoad
{
	NSLog(@"Nib file is loaded");
}

And here is my AppController.m:

Code:
#import "AppController.h"
#import "PreferenceController.h"

@implementation AppController

-(IBAction)showPreferencePanel:(id)sender
{
	//Is the prefenceController nil?
	if (!preferenceController) {
		preferenceController =[[PreferenceController alloc]init];
	}
	NSLog(@"showing %@", preferenceController);
	[preferenceController showWindow:self];
}
@end
Thanks in advance.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.