Re: NSArray and C array
Re: NSArray and C array
- Subject: Re: NSArray and C array
- From: Ondra Cada <email@hidden>
- Date: Sun, 28 Oct 2001 10:38:18 +0100
Drew,
>
>>>>> Drew McCormack (DMC) wrote at Sat, 27 Oct 2001 21:39:47 -0700:
DMC> I think I can remember seeing in the documentation an example which cast
DMC> an NSArray to a C array, but I can't seem to find it. I think it was
DMC> something along these lines:
DMC>
DMC> NSArray *array = [NSArray arrayWithObject:obj];
DMC> id *carray;
DMC> carray = (id *)array;
DMC> [carray[0] doSomething];
DMC>
DMC> Is this possible?
Nope, it is plain impossible. You can cast an NSArray to a CFArray, which is
quite a different beast than the plain C array: CoreFoundation is, to some
extent, still the same object oriented API, just with an ugly plain C
interface.
---
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