Re: How do I make NSData from cabron-Handle
Re: How do I make NSData from cabron-Handle
- Subject: Re: How do I make NSData from cabron-Handle
- From: Ondra Cada <email@hidden>
- Date: Sat, 26 Jan 2002 17:16:16 +0100
Finlay,
>
>>>>> Finlay Dobbie (FD) wrote at Sat, 26 Jan 2002 16:09:55 +0000:
FD> >IIRC (it's a long long time I've programmed Classic), handle is just a
FD> >double pointer, right? Well, if so, you need to know the size of the
FD> >data,
FD> >and then you can do
FD> >
FD> >NSData *d=[NSData dataWithBytes:*handle length:sizeWhichYouKnow];
FD>
FD> That should be **handle, right? :-P
Wrong.
That would get the first byte (presumed Handle is declared as void**, and
using the GCC convention of being able to dereference void* as char*) of the
data, and interpreting it as an address. I very seriously doubt you would
like that ;)
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc