• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSBundle now...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • NSMovieView's controller is greyed out - why?
      • From: "Tamara L. Cravit" <email@hidden>
References: 
 >Re: NSBundle now... (From: mathew <email@hidden>)

  • Prev by Date: Re: COM blah...
  • Next by Date: Re: COM on mac
  • Previous by thread: Re: NSBundle now...
  • Next by thread: NSMovieView's controller is greyed out - why?
  • Index(es):
    • Date
    • Thread