Re: NSData object trouble with <16KB
Re: NSData object trouble with <16KB
- Subject: Re: NSData object trouble with <16KB
- From: Ondra Cada <email@hidden>
- Date: Thu, 22 Apr 2004 23:14:59 +0200
David,
On 22.4.2004, at 22:47, David Piasecki wrote:
>
NSData *data = [NSData alloc];
>
[data initWithBytes:getData() length:getDataLength()];
>
>
getData() returns a char *
>
getDataLength() returns an int
>
>
The "data" ends up being of size 0 bytes. If the size of the data I
>
pass in is greater than 16KB, there is no problem. Unfortunately, I may
>
have data sizes smaller than 16KB. Has anyone ran into this problem,
>
and do you know of some way around it, or perhaps I'm doing something
>
wrong?
*NEVER EVER* separate alloc and init to two different lines. That's the
culprit -- init returns a different object (which it can do any time,
and for class clusters it of course does indeed).
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.