Carbon Handles & NSData
Carbon Handles & NSData
- Subject: Carbon Handles & NSData
- From: Philip Streck <email@hidden>
- Date: Sun, 25 Aug 2002 15:13:11 -0400
I'm working on a document based application and want to read a OS X icns
file through an NSDocument subclass, I would prefer not to have to
override writeToFile and readFromFile. So within the
loadDataRepresentation method I want to initialize an IconFamilyHandle
with the contents of NSData. Here is basically what I'm trying to do,
but when I'm calling SetIconFamilyData it returns -50 which is an
invalid parameter. I'm new to both Cocoa and Carbon programming and any
help would be appreciated.
OSErr result = 0;
Handle dataHandle;
result = PtrToHand( [data bytes], &dataHandle, [data length] );
//error checking...
result = SetIconFamilyData( hIconFamily, 'icns', dataHandle );
//error checking...
Thanks,
Phil
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.