Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Cocoa apps opening resource files...

Cocoa apps opening resource files...
Thread Tools
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Jun 25, 2001, 03:47 AM
 
I myself don't need this info. But the person who did was having some trouble having cocoa read resource files. The app will be a Theme Maker for OS X. Right now we decided on ThemeFactory. It's probobally going to change. Anyways, if you have any info on how a cocoa app might open a resource file such as Extras.rsrc please at least steer him in the right direction. Thanks,

synotic@mac.com
     
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status: Offline
Reply With Quote
Jun 25, 2001, 07:08 AM
 
I think that in extras.rsrc all of the resources are in the data fork and not the resource fork so that's probably where your confusion lies. You can just read the data fork into an NSData object. On the other hand, if you need more flexibility, which is likely since NSData objects aren't as useful as they could be, then just use some file manager functions. If you have the developer tools installed, then you can find the documentation at

file:///Developer/Documentation/Carbon/Files/FileManager/File_Manager/File_Manager.html

Hint: You can still use the standard unix style of paths when you use the file manager functions. Just use the FSPathMakeRef function to convert it into an FSRef for use with the file manager.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 25, 2001, 01:59 PM
 
There is no API in Cocoa for manipulating resource forks. You'll have to use Carbon. Even if you get the .rsrc file into an NSData, that's probably not terribly useful. See http://www.cocoadev.com/index.pl?UsingResourceForks
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:25 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2