• 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
Re: How do I make NSData from cabron-Handle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I make NSData from cabron-Handle


  • Subject: Re: How do I make NSData from cabron-Handle
  • From: Jim Correia <email@hidden>
  • Date: Sat, 26 Jan 2002 11:09:37 -0500

At 5:53 PM +0200 1/26/02, Gore wrote:

hmm, yeah, but I want the data in the handle to be encoded, I want the *data* to be saved to the HD using coco calls =)

possible ?

If the contents of the handle are flat (they don't reference external structures) then it should be quite easy. Something like this (typed into email client, not compiled, not tested)

- (NSData *)dataWithHandle:(Handle)h
{
// on 9 we would lock the handle, on X handles
// only move if you resize them

return [NSData dataWithBytes: (*h) length: GetHandleSize(h)];
}

- (Handle)newHandleFromData:(NSData *)
{
Handle h = NewHandle([data length]);

if (h != NULL)
[data getBytes: *h]

return h;
}


  • Follow-Ups:
    • Re: How do I make NSData from cabron-Handle
      • From: Gore <email@hidden>
References: 
 >Re: How do I make NSData from cabron-Handle (From: Gore <email@hidden>)

  • Prev by Date: Re: How viable is Cocoa development?
  • Next by Date: Re: How do I make NSData from cabron-Handle
  • Previous by thread: Re: How do I make NSData from cabron-Handle
  • Next by thread: Re: How do I make NSData from cabron-Handle
  • Index(es):
    • Date
    • Thread