I think the best way to do it is to use the Carbon Resource Manager calls. They're actually pretty straightforward, and it doesn't take much work to extract the raw data to an NSData, from which you can do all your editing using standard cocoa calls. When you've modified the data, it's also not that hard to lump it back into the resource fork.
I found the most annoying part of the whole process to be generating the FSSpec to pass to the legacy FSpOpenResFile() call.
Code I'm using to load a res file, given an NSString with the file path. This will open it with Read/Write permissions. (As given by the fsRdWrPerm constant used in the FSpOpenResFile() call):
int LoadResFork(NSString* path) {
char filepath(256);
strcpy(filepath, (path cString));
FSSpec ResFileSpec;
FSRef ResFileRef;
OSErr err;
err = FSPathMakeRef((const UInt8*)filepath, &ResFileRef, false);
OSErr SpecErr;
SpecErr = FSGetCatalogInfo(&ResFileRef, kFSCatInfoNone, NULL, NULL, &ResFileSpec, NULL);
short Ref;
Ref = FSpOpenResFile(&ResFileSpec, fsRdWrPerm);
OSErr ResErr = ResError();
if (ResErr < 0) return ResErr;
else return Ref;
}
To then load a resource of, say, type desc with id 128 into an NSData you'd use:
UseResFile(refNum);
Handle theResHandle = Get1Resource(TYPE_DESC, 128); // Where TYPE_DESC is a constant defined to equal the dësc ResType, which happens to be 1687253859.
NSData *theResourceData;
theResourceData = ((NSData alloc) initWithBytes:*theResHandle size:GetMaxResourceSize(theResHandle));
Once this code is in there, you can just pull out chunks of data you want to use by making an NSRange, and using the getBytes:range: method on the NSData object.
To save data, just set up the NSData to contain the data you want to dump back to a resource and use
(where theData is the NSData object):
Handle h = Get1Resource(TYPE_DESC, 128);
SetHandleSize(h, (theData length));
(theData getBytes:*h);
ChangedResource(h);
WriteResource(h);
UpdateResFile(filRefNum);
Keep in mind to call ResError() after any resource manager calls, and make sure it returns noErr before continuing.