Re: Loading include files from a bundle
Re: Loading include files from a bundle
- Subject: Re: Loading include files from a bundle
- From: Sherm Pendley <email@hidden>
- Date: Thu, 6 Feb 2003 11:48:30 -0500
On Thursday, February 6, 2003, at 10:13 AM, Erick van Rijk wrote:
The app I'm working on needs to know where I have put my separate
include files. My first thought was to put them in a folder "include"
inside the main bundle and look for them using this routine
includePath = [[NSBundle mainBundle] pathForResource:@"include"
ofType:@"bundle"];
But when I do NSLog( @"includePath is %@",includePath );
it returns returns includePath is (null). So I conclude it can't find
my include directory.
That's because you're not telling it to look for an include directory.
You're telling it look for a file named 'include.bundle' in the
Resources directory.
It sounds like what you really want is this:
[[NSBundle mainBundle] pathForResource: @"filename" ofType: @"h"
inDirectory: @"include"];
If you want an NSArray with paths to all your header files, you could
use this:
[[NSBundle mainBundle] pathsForResourcesOfType: @"h" inDirectory:
@"include"];
Or, if all you want is the full path to your include directory, you
could do this:
NSString *incPath = [[[NSBundle mainBundle] resourcePath]
stringByAppendingString: @"/include"];
sherm--
UNIX: Where /sbin/init is Job 1.
_______________________________________________
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.