• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
General weirdness with [self window]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Compiling AppleScript in Cocoa?
  • Next by Date: Subclassing NSTableColumn
  • Previous by thread: Re: Compiling AppleScript in Cocoa?
  • Next by thread: Re: General weirdness with [self window]
  • Index(es):
    • Date
    • Thread