loading a Nib in Java
loading a Nib in Java
- Subject: loading a Nib in Java
- From: John Timmer <email@hidden>
- Date: Sun, 18 Nov 2001 23:22:26 -0500
In order to cut down on the general chaos of a project, I'm trying to
separate things into a nib per window. Unfortunately, I can't figure out
how to load the nib in Java. The bundle additions that let you do it with a
single message don't seem to have been bridged, leaving me with only
NSWindowController.
Unfortunately, I can't seem to get that to work. I've created an empty nib,
added a window and a custom class, and inserted it into my project. I've
then tried nearly every method imaginable to load it using the
NSWindowController constructor. For example, using the code:
String tempString = theBundle.resourcePath() + "/test.nib";
theWinOwner = new NSWindowController(tempString);
I can see that the appropriate path to my resources folder is in the string,
but things seem to go sour after that. I get the following error:
[2264] -[NSWindowController loadWindow]: failed to load window nib file
I've also tried various gyrations with different NSBundle methods, and none
of them seem to work. I can't tell whether it's something about the nib
creation process that I did wrong, or that I'm pointing the window
controller at the wrong thing.
While i'm on this topic, what happens if you do this when there's more than
one window in the nib you're loading?
Thanks for any help,
Jay