• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Carbon Handles & NSData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Carbon Handles & NSData
      • From: Pierre-Olivier Latour <email@hidden>
  • Prev by Date: jaguar dev tools installer stalls
  • Next by Date: Re: Getting the IP address with remote DO
  • Previous by thread: Re:jaguar dev tools installer stalls
  • Next by thread: Re: Carbon Handles & NSData
  • Index(es):
    • Date
    • Thread