Re: Can't Load Resources
Re: Can't Load Resources
- Subject: Re: Can't Load Resources
- From: Ricky Sharp <email@hidden>
- Date: Tue, 08 Jun 2004 12:06:38 -0500
On Tuesday, June 08, 2004, at 10:15AM, Ken Brooks <email@hidden> wrote:
>Under a target I find two headings: Bundle Resources, and Resource Manager Resources.
>In one project the program couldn't load its resources until I moved the resource file into Resource Manager Resources. In a very similar project I did the same and the program STILL can't load its resources. (I have a MENU 10 that I use as my test item; GetResource fails to load it.)
>
> What is this distinction all about? Can someone point me to a help page that really explains the whole resource deal in this new world?
Bundle Resources are basically any file that you want to place in the Resource folder in your bundle (e.g. image files).
Resource Manager Resources are special "items" contained in a single file that are to be used with the Resource Manager APIs (e.g. GetResource). In the old days, you would put many user-interface items in the resource-fork of your application binary. You'd also put icons, document-binding info, strings, etc in there too.
By using nibs, you can move away from using Res Mgr resources for your UI and any STR#, STR, etc. resources can be replaced by .strings files.
I still use Res Mgr resources, but now only for my proprietary data types.
Xcode will take any .r (raw text-file describing resources), .rsrc (resource-fork-based files), and merge them into a single data-fork-based .rsrc file that is placed inside the Resource folder in your bundle. The root name of the .rsrc file will match the root name of your application. Upon startup, the runtime system loads this data-fork-based file for you and you can issue the Resource Manager API calls as if those resources lived in the resource-fork on the app binary.
Icon data (.icns files) and image data (.pct, .jpg, etc.) can live as resource-based data, but often are more convenient as being separate files. For example, my application allows users to download new themes. Each theme file is placed inside the bundle's Resource folder and also has a corresponding thumnail (.pct) file. My app makes use of the "Get Resource" APIs in CFBundle.h. The application icon and any document icons are stored as .icns files in the Resource folder.
HTH,
Rick Sharp
Instant Interactive(tm)
_______________________________________________
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.