pathForResource:ofType: failes under panther.
pathForResource:ofType: failes under panther.
- Subject: pathForResource:ofType: failes under panther.
- From: Fredrik Olsson <email@hidden>
- Date: Wed, 12 Jul 2006 16:35:31 +0200
This method located in a framework bundled with the application failes
to get he path to the nib under Panther, but works like a charm under
Tiger:
- (void)makeWindowControllers
{
NSBundle *bundle = [NSBundle bundleForClass:[MTGMTXDocument class]];
if (bundle) {
NSLog([bundle bundlePath]);
NSLog([bundle bundleIdentifier]);
NSLog([bundle isLoaded] ? @"Is loadded" : @"Is not loaded");
NSString *nibPath = [bundle pathForResource:@"StandardWindow"
ofType:@"nib"];
if (nibPath) {
NSWindowController *controller = [[MTWindowController alloc]
initWithWindowNibPath:nibPath owner:self];
[self addWindowController: controller];
[controller testStuff:self];
RELEASE(controller);
} else {
NSLog(@"Could not get nib path");
}
} else {
NSLog(@"Could not get bundle");
}
}
I get no error messages, in any logs, it just silently return nil.
The nib and MTGMTXDocument class are in the same framework. The actual
class of the instance when this gets executed is a subclass of
MTGMTXDocument, and is loaded from a separate plug-in bundle.
// Fredrik Olsson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden