Le 20 mars 08 à 06:26, Michael Ash a écrit :
On Thu, Mar 20, 2008 at 12:56 AM, Jens Alfke [EMAIL PROTECTED]
wrote:
It's never a good idea to
make assumptions about where a Foundation object is putting its data;
if you need to access the current bytes of an NSData, call -bytes
on it.
This
On Thu, Mar 20, 2008 at 2:58 AM, Jean-Daniel Dupas
[EMAIL PROTECTED] wrote:
Le 20 mars 08 à 06:26, Michael Ash a écrit :
On Thu, Mar 20, 2008 at 12:56 AM, Jens Alfke [EMAIL PROTECTED]
wrote:
It's never a good idea to
make assumptions about where a Foundation object is putting its
I'm probably missing something that's obvious but not so much to me
right now...
I have an NSArray category method that takes an NSArray of NSString
objects, and returns a C array of C strings (char * const *). This is
so I can build a C array for some functions that require a C array.
On 20/03/2008, at 10:38 AM, Nick Zitzmann wrote:
char **returnArray = NSZoneMalloc([self zone], length);
should be:
char **returnArray = NSZoneMalloc([self zone], length * sizeof (char
*));
- Chris
___
Cocoa-dev mailing list
On 19 Mar 08, at 16:50, Chris Suter wrote:
On 20/03/2008, at 10:38 AM, Nick Zitzmann wrote:
char **returnArray = NSZoneMalloc([self zone], length);
should be:
char **returnArray = NSZoneMalloc([self zone], length * sizeof
(char *));
Actually, that's correct. Read up a bit -
On Thu, Mar 20, 2008 at 12:00 AM, Andrew Farmer [EMAIL PROTECTED] wrote:
What's bothering me a lot more is the use of an appendByte: method.
Also bothering me is that a single-byte nul is only correct for
certain encodings.
Hamish
___
Cocoa-dev
On 20/03/2008, at 11:00 AM, Andrew Farmer wrote:
On 19 Mar 08, at 16:50, Chris Suter wrote:
On 20/03/2008, at 10:38 AM, Nick Zitzmann wrote:
char **returnArray = NSZoneMalloc([self zone], length);
should be:
char **returnArray = NSZoneMalloc([self zone], length * sizeof
(char
On Thu, Mar 20, 2008 at 12:18 AM, Chris Suter
[EMAIL PROTECTED] wrote:
I think it's because
[NSMutableData dataWithBytesNoCopy:returnArray length:length]
is releasing returnArray and allocating a new buffer for it.
I, for one, am surprised that NSMutableData works this way, given that
a)
On Mar 19, 2008, at 6:18 PM, Chris Suter wrote:
I think it's because
[NSMutableData dataWithBytesNoCopy:returnArray length:length]
is releasing returnArray and allocating a new buffer for it. I'm
guessing that's because it's NSMutableData.
To fix it, use NSData instead.
Ding ding ding!
On Wed, Mar 19, 2008 at 7:49 PM, Hamish Allan [EMAIL PROTECTED] wrote:
On Thu, Mar 20, 2008 at 12:18 AM, Chris Suter
[EMAIL PROTECTED] wrote:
I think it's because
[NSMutableData dataWithBytesNoCopy:returnArray length:length]
is releasing returnArray and allocating a new buffer for
On Mar 19, 2008, at 6:49 PM, Hamish Allan wrote:
I, for one, am surprised that NSMutableData works this way, given that
a) the method name specifically requests that no copy is made, and b)
there's no particular reason for it to behave that way unless the data
is resized.
Thanks again
On 20/03/2008, at 12:31 PM, Nick Zitzmann wrote:
On Mar 19, 2008, at 6:49 PM, Hamish Allan wrote:
I, for one, am surprised that NSMutableData works this way, given
that
a) the method name specifically requests that no copy is made, and b)
there's no particular reason for it to behave that
On Thu, Mar 20, 2008 at 12:56 AM, Jens Alfke [EMAIL PROTECTED] wrote:
It's never a good idea to
make assumptions about where a Foundation object is putting its data;
if you need to access the current bytes of an NSData, call -bytes on it.
This was a little confusing to me until I thought
13 matches
Mail list logo