Re: NSBundle
Re: NSBundle
- Subject: Re: NSBundle
- From: Douglas Davidson <email@hidden>
- Date: Mon, 2 Jul 2001 09:40:29 -0700
I believe what Eric was recommending was something more like this:
MyApp.app
Contents
MacOS
MyApp
Resources
bible
bibledata
English.lproj
MyApp.nib
Then in MyApp,
[theTask setLaunchPath:[[NSBundle mainBundle] pathForResource:@"bible"
ofType:@""]];
Douglas Davidson
On Monday, July 2, 2001, at 08:43 AM, Darin Duphorne wrote:
I can't figure this out. I've read the foundation description of
NSBundle and without some example code, the description isn't enough.
For example, I can't even figure out if I need to name my folder
containing the binary and data files with a .bundle name or some other
name. I also can't figure out what the "type" ought to be. Also, (when
used stand-alone) the binary normally requires that the data file either
be in the same directory as the binary or in the /usr/lib directory. It
runs fine outside the project bundle, but when added to the project, it
says the NSBundle is nil. Here's my code (both the binary (named
"bible") and its data files are in a directory called "bible.command".)
...
theTask=[[NSTask alloc] init];
[theArgs addObject:[brsEntryField stringValue]];
[theTask setLaunchPath:[[NSBundle mainBundle] pathForResource:@"bible"
ofType:@".command"]];
[theTask setArguments:theArgs];
[theTask setStandardOutput:thePipe];
[brsDisplayField setString:@""];
[theTask launch];
...
References: | |
| >NSBundle (From: Darin Duphorne <email@hidden>) |