General weirdness with [self window]
General weirdness with [self window]
- Subject: General weirdness with [self window]
- From: Michael Norris <email@hidden>
- Date: Thu, 16 Oct 2003 11:57:41 +1300
Hi there. I'd really appreciate any help on this problem.
I'm observing some odd behaviour with my .nib loading methods. I have
an application which can open one of about 20 .nibs depending on which
button the user presses. The application grabs the name of the
controller class from an XML file (from which it has programatically
designed the UI) and loads that controller class using the following
code:
newController = [[[NSClassFromString(module) alloc] init] autorelease];
if (newController) {
[moduleControllers setObject:newController forKey:module];
}
Now, this has worked fine for 19/20 of my controllers, but the most
recent one causes a problem.
The initialisation method of the controller (an NSWindowController
subclass) looks very simple, loading a nib, then calling [self window]
to initialise all the IBOutlets and load the window:
- (id) init {
self = [super initWithWindowNibName:@"M105RDictMainScreen"];
if (self) {
[self window];
}
return self;
}
But in my most recent controller, execution stops at [self window],
with an error message reading:
-[NSCFArray objectAtIndex:]: index (-3) beyond bounds (0)
Which is just weird... I would expect something like this to happen if
I'd misspelt the nib name, but I've checked and rechecked, and it's
fine. Any other thoughts??
-mike
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.