Re: NSBundle now...
Re: NSBundle now...
- Subject: Re: NSBundle now...
- From: Vince DeMarco <email@hidden>
- Date: Wed, 15 Jan 2003 08:04:03 -0800
On Tuesday, January 14, 2003, at 04:54 PM, mathew wrote:
On Tuesday, January 14, 2003, at 03:51 PM, Rhon Fitzwater wrote:
I added the perl script to the resources folder in project
builder(main.pl) and made sure it was checked. And here is a snippet
of
the code that I have:
[...]
In the console.log after running the program I get this:
"This is the path: "
&
"[NSPlaceholderString initWithString:]: nil string (or other)
argument"
So basically this is telling me that the path variable is empty. But
why? Am I setting something wrong?
I dunno, but here's what I do:
filespec = [NSString stringWithFormat:@"%@/%@",
[[NSBundle bundleForClass:[self class]] resourcePath ], filename ];
filename is the name of the file inside the application bundle,
filespec is the fully qualified path you can access it via.
You should not do this.
convert the above to
filespec = [[NSBundle bundleForClass:[self class]]
pathForResource:@"filename" ofType:@"type"];
instead.
_______________________________________________
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.