Re: pathForResource:ofType: failes under panther. (SOLVED)
Re: pathForResource:ofType: failes under panther. (SOLVED)
- Subject: Re: pathForResource:ofType: failes under panther. (SOLVED)
- From: Fredrik Olsson <email@hidden>
- Date: Thu, 13 Jul 2006 15:30:13 +0200
Fredrik Olsson skrev:
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.
Turns out that the symlinks in frameworks gets screwed up when copied
through a Samba volume.
// 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
_______________________________________________
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