Re: Adding resources to the Application
Re: Adding resources to the Application
- Subject: Re: Adding resources to the Application
- From: Sherm Pendley <email@hidden>
- Date: Thu, 14 Jul 2005 14:23:38 -0400
On Jul 14, 2005, at 1:25 PM, Nik Bauman wrote:
So I have a giant plist file that I want inside my application bundle,
but I'm having trouble figuring out how to access it.
I have the plist in the "Resources" folder within Xcode, but how do I
access this file programatically now?
NSBundle is your friend:
NSBundle *mb = [NSBundle mainBundle];
NSString *path = [mb pathForResource:@"giant" ofType:@"plist"];
There are lots of variant -pathForResource:ofType: methods, for
looking in other bundles, returning more than one path, looking for
localized resources, etc. Have a look at NSBundle docs for details.
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden