Re: Variadic arguments to methods in Objective-C - How ?
Re: Variadic arguments to methods in Objective-C - How ?
- Subject: Re: Variadic arguments to methods in Objective-C - How ?
- From: "Erik M. Buck" <email@hidden>
- Date: Sat, 8 Jan 2005 17:23:59 -0500
>works like a charm, altho if there is a better way to do this I am all
>ears !
If all you want is dynamic storage for ints and you don't need to create
lots of NSNumber instance,
how about NSMutableData and use the -mutableBytes method to access memory as
an array of ints ?
You can increate the size of the storage at will: -increaseLengthBy:
NSMutableData aBunchOfInts = [NSMutableData dataWithLength:(4 *
sizeof(int)];
int *bytes = [aBunchOfInts mutableBytes];
bytes[0] = 45;
bytes[3] = 11;
[aBunchOfInts -increaseLengthBy:16];
bytes[19] = -29;
[aBunchOfInts appendBytes:someMoreIntsInACArray length:someLengthInBytes];
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden