• 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: Using Resource Files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Resource Files


  • Subject: Re: Using Resource Files
  • From: Stéphane Sudre <email@hidden>
  • Date: Sun, 7 Dec 2003 14:45:20 +0100

On dimanche, dicembre 7, 2003, at 07:09  AM, Troy Dawson wrote:

On Dec 6, 2003, at 9:26 PM, Tim Rupe wrote:

Resources folder in my build, but my application can't see them.  Is
there a special path I should use in my program that will access the
Resources folder of my application package

This is an AppKit/Foundation question more or less:

	NSString* full_path = [[[NSBundle mainBundle] resourcePath]
stringByAppendingPathComponent: @"your_filename_here.img"];
	NSData* data = [NSData dataWithContentsOfFile: full_path];

I would rather use this method:

NSString* full_path = [[NSBundle mainBundle] pathForResource:@"your_filename_here" ofType:@"img"];

because there's one call less and it supports localized Resources.
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Using Resource Files (From: Troy Dawson <email@hidden>)

  • Prev by Date: Re: getcwd acts different in xcode/finder
  • Next by Date: Re: getcwd acts different in xcode/finder
  • Previous by thread: Re: Using Resource Files
  • Next by thread: Re: Using Resource Files
  • Index(es):
    • Date
    • Thread